test_class.declarator: versionService
test_class.modifier: @Autowired
      private
test_class.original_string: @Autowired
      private VersionService versionService;
test_class.type: VersionService
test_class.var_name: versionService
test_class.declarator: repository
test_class.modifier: @Autowired
      private
test_class.original_string: @Autowired
      private PreparationRepository repository;
test_class.type: PreparationRepository
test_class.var_name: repository
test_class.file: dataprep-backend-service/src/test/java/org/talend/dataprep/preparation/store/file/FileSystemPreparationRepositoryTest.java
test_class.identifier: FileSystemPreparationRepositoryTest
test_class.superclass: extends PreparationRepositoryTest
test_case.body: @Test
      public void shouldGetOnlyWantedClass() {
          final Step expected = new Step(Step.ROOT_STEP.id(), "8rq4868", versionService.version().getVersionId());
          repository.add(expected);
          assertNull(repository.get(expected.id(), Preparation.class));
          assertNull(repository.get(expected.id(), PreparationActions.class));
      }
test_case.class_method_signature: FileSystemPreparationRepositoryTest.shouldGetOnlyWantedClass()
test_case.full_signature: @Test public void shouldGetOnlyWantedClass()
test_case.identifier: shouldGetOnlyWantedClass
test_case.invocations: id getVersionId version add assertNull get id assertNull get id
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void shouldGetOnlyWantedClass()
focal_class.declarator: LOG = LoggerFactory.getLogger(FileSystemPreparationRepository.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOG = LoggerFactory.getLogger(FileSystemPreparationRepository.class);
focal_class.type: Logger
focal_class.var_name: LOG
focal_class.declarator: mapper
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private ObjectMapper mapper;
focal_class.type: ObjectMapper
focal_class.var_name: mapper
focal_class.declarator: preparationsLocation
focal_class.modifier: @Value("${preparation.store.file.location}")
      private
focal_class.original_string: @Value("${preparation.store.file.location}")
      private String preparationsLocation;
focal_class.type: String
focal_class.var_name: preparationsLocation
focal_class.declarator: security
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private Security security;
focal_class.type: Security
focal_class.var_name: security
focal_class.file: dataprep-backend-service/src/main/java/org/talend/dataprep/preparation/store/file/FileSystemPreparationRepository.java
focal_class.identifier: FileSystemPreparationRepository
focal_class.class_method_signature: FileSystemPreparationRepository.init()
focal_class.full_signature: @PostConstruct private void init()
focal_class.identifier: init
focal_class.modifiers: @PostConstruct private
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void init()
focal_class.class_method_signature: FileSystemPreparationRepository.add(Identifiable object)
focal_class.full_signature: @Override public void add(Identifiable object)
focal_class.identifier: add
focal_class.modifiers: @Override public
focal_class.parameters: (Identifiable object)
focal_class.return: void
focal_class.signature: void add(Identifiable object)
focal_class.class_method_signature: FileSystemPreparationRepository.source(Class<T> clazz)
focal_class.full_signature: @Override public Stream<T> source(Class<T> clazz)
focal_class.identifier: source
focal_class.modifiers: @Override public
focal_class.parameters: (Class<T> clazz)
focal_class.return: Stream<T>
focal_class.signature: Stream<T> source(Class<T> clazz)
focal_class.class_method_signature: FileSystemPreparationRepository.read(String id, Class<T> clazz)
focal_class.full_signature: private T read(String id, Class<T> clazz)
focal_class.identifier: read
focal_class.modifiers: private
focal_class.parameters: (String id, Class<T> clazz)
focal_class.return: T
focal_class.signature: T read(String id, Class<T> clazz)
focal_class.class_method_signature: FileSystemPreparationRepository.clear()
focal_class.full_signature: @Override public void clear()
focal_class.identifier: clear
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void clear()
focal_class.class_method_signature: FileSystemPreparationRepository.remove(Identifiable object)
focal_class.full_signature: @Override public void remove(Identifiable object)
focal_class.identifier: remove
focal_class.modifiers: @Override public
focal_class.parameters: (Identifiable object)
focal_class.return: void
focal_class.signature: void remove(Identifiable object)
focal_class.class_method_signature: FileSystemPreparationRepository.getIdentifiableFile(Identifiable object)
focal_class.full_signature: private File getIdentifiableFile(Identifiable object)
focal_class.identifier: getIdentifiableFile
focal_class.modifiers: private
focal_class.parameters: (Identifiable object)
focal_class.return: File
focal_class.signature: File getIdentifiableFile(Identifiable object)
focal_class.class_method_signature: FileSystemPreparationRepository.getIdentifiableFile(Class clazz, String id)
focal_class.full_signature: private File getIdentifiableFile(Class clazz, String id)
focal_class.identifier: getIdentifiableFile
focal_class.modifiers: private
focal_class.parameters: (Class clazz, String id)
focal_class.return: File
focal_class.signature: File getIdentifiableFile(Class clazz, String id)
focal_class.class_method_signature: FileSystemPreparationRepository.stripOptionalPrefix(Class clazz, String id)
focal_class.full_signature: private String stripOptionalPrefix(Class clazz, String id)
focal_class.identifier: stripOptionalPrefix
focal_class.modifiers: private
focal_class.parameters: (Class clazz, String id)
focal_class.return: String
focal_class.signature: String stripOptionalPrefix(Class clazz, String id)
focal_class.class_method_signature: FileSystemPreparationRepository.getRootFolder()
focal_class.full_signature: private File getRootFolder()
focal_class.identifier: getRootFolder
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: File
focal_class.signature: File getRootFolder()
focal_class.superclass: extends ObjectPreparationRepository
focal_method.body: @Override
      public void add(Identifiable object) {
  
          // defensive programming
          if (object == null) {
              LOG.warn("cannot save null...");
              return;
          }
  
          final File outputFile = getIdentifiableFile(object);
          try {
              FileUtils.touch(outputFile);
          } catch (IOException e) {
              LOG.error("Unable to prepare file for {}.", object, e);
          }
  
          try (GZIPOutputStream output = new GZIPOutputStream(new FileOutputStream(outputFile))) {
              mapper.writer().writeValue(output, object);
          } catch (IOException e) {
              LOG.error("Error saving {}", object, e);
              throw new TDPException(CommonErrorCodes.UNABLE_TO_SAVE_PREPARATION, e,
                      ExceptionContext.build().put("id", object.id()));
          }
          LOG.debug("{} #{} saved", object.getClass().getSimpleName(), object.id());
      }
focal_method.class_method_signature: FileSystemPreparationRepository.add(Identifiable object)
focal_method.full_signature: @Override public void add(Identifiable object)
focal_method.identifier: add
focal_method.invocations: warn getIdentifiableFile touch error writeValue writer error put build id debug getSimpleName getClass id
focal_method.modifiers: @Override public
focal_method.parameters: (Identifiable object)
focal_method.return: void
focal_method.signature: void add(Identifiable object)