test_class.declarator: formatAnalysis
test_class.modifier: @Autowired
test_class.original_string: @Autowired
      FormatAnalysis formatAnalysis;
test_class.type: FormatAnalysis
test_class.var_name: formatAnalysis
test_class.file: dataprep-dataset/src/test/java/org/talend/dataprep/dataset/service/analysis/synchronous/FormatAnalysisTest.java
test_class.identifier: FormatAnalysisTest
test_class.superclass: extends DataSetBaseTest
test_case.body: @Test
      public void testUpdate() {
          String id = UUID.randomUUID().toString();
          final DataSetMetadata metadata = metadataBuilder.metadata().id(id).build();
          dataSetMetadataRepository.save(metadata);
          contentStore.storeAsRaw(metadata, DataSetServiceTest.class.getResourceAsStream("../avengers.csv"));
          formatAnalysis.analyze(id);
          final DataSetMetadata original = dataSetMetadataRepository.get(id);
          final DataSetMetadata modified = dataSetMetadataRepository.get(id);
          modified.setEncoding("windows-1252");
          modified.getContent().getParameters().put("SEPARATOR", ",");
  
          formatAnalysis.update(original, modified);
  
          final DataSetMetadata updated = dataSetMetadataRepository.get(id);
          assertNotNull(updated);
          assertThat(updated.getContent().getFormatFamilyId(), is(CSVFormatFamily.BEAN_ID));
          assertThat(updated.getContent().getMediaType(), is("text/csv"));
          assertThat(updated.getEncoding(), is("windows-1252"));
          //assertThat(updated.getContent().getParameters().get("SEPARATOR"), is(";"));
  
      }
test_case.class_method_signature: FormatAnalysisTest.testUpdate()
test_case.full_signature: @Test public void testUpdate()
test_case.identifier: testUpdate
test_case.invocations: toString randomUUID build id metadata save storeAsRaw getResourceAsStream analyze get get setEncoding put getParameters getContent update get assertNotNull assertThat getFormatFamilyId getContent is assertThat getMediaType getContent is assertThat getEncoding is
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testUpdate()
focal_class.declarator: NO_BOM = {}
focal_class.modifier: private static final
focal_class.original_string: private static final byte[] NO_BOM = {};
focal_class.type: byte[]
focal_class.var_name: NO_BOM
focal_class.declarator: UTF_16_LE_BOM = { (byte) 0xFF, (byte) 0xFE }
focal_class.modifier: private static final
focal_class.original_string: private static final byte[] UTF_16_LE_BOM = { (byte) 0xFF, (byte) 0xFE };
focal_class.type: byte[]
focal_class.var_name: UTF_16_LE_BOM
focal_class.declarator: UTF_16_BE_BOM = { (byte) 0xFE, (byte) 0xFF }
focal_class.modifier: private static final
focal_class.original_string: private static final byte[] UTF_16_BE_BOM = { (byte) 0xFE, (byte) 0xFF };
focal_class.type: byte[]
focal_class.var_name: UTF_16_BE_BOM
focal_class.declarator: UTF_32_LE_BOM = { (byte) 0xFE, (byte) 0xFF, (byte) 0x00, (byte) 0x00 }
focal_class.modifier: private static final
focal_class.original_string: private static final byte[] UTF_32_LE_BOM = { (byte) 0xFE, (byte) 0xFF, (byte) 0x00, (byte) 0x00 };
focal_class.type: byte[]
focal_class.var_name: UTF_32_LE_BOM
focal_class.declarator: UTF_32_BE_BOM = { (byte) 0x00, (byte) 0x00, (byte) 0xFE, (byte) 0xFF }
focal_class.modifier: private static final
focal_class.original_string: private static final byte[] UTF_32_BE_BOM = { (byte) 0x00, (byte) 0x00, (byte) 0xFE, (byte) 0xFF };
focal_class.type: byte[]
focal_class.var_name: UTF_32_BE_BOM
focal_class.declarator: UTF_8_BOM = { (byte) 0xEF, (byte) 0xBB, (byte) 0xBF }
focal_class.modifier: private static final
focal_class.original_string: private static final byte[] UTF_8_BOM = { (byte) 0xEF, (byte) 0xBB, (byte) 0xBF };
focal_class.type: byte[]
focal_class.var_name: UTF_8_BOM
focal_class.declarator: BOMS =
              { NO_BOM, UTF_16_LE_BOM, UTF_16_BE_BOM, UTF_32_LE_BOM, UTF_32_BE_BOM, UTF_8_BOM }
focal_class.modifier: private static final
focal_class.original_string: private static final byte[][] BOMS =
              { NO_BOM, UTF_16_LE_BOM, UTF_16_BE_BOM, UTF_32_LE_BOM, UTF_32_BE_BOM, UTF_8_BOM };
focal_class.type: byte[][]
focal_class.var_name: BOMS
focal_class.declarator: LOG = LoggerFactory.getLogger(FormatAnalysis.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOG = LoggerFactory.getLogger(FormatAnalysis.class);
focal_class.type: Logger
focal_class.var_name: LOG
focal_class.declarator: repository
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private DataSetMetadataRepository repository;
focal_class.type: DataSetMetadataRepository
focal_class.var_name: repository
focal_class.declarator: store
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private ContentStoreRouter store;
focal_class.type: ContentStoreRouter
focal_class.var_name: store
focal_class.declarator: formatFamilyFactory
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private FormatFamilyFactory formatFamilyFactory;
focal_class.type: FormatFamilyFactory
focal_class.var_name: formatFamilyFactory
focal_class.declarator: detector
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private CompositeFormatDetector detector;
focal_class.type: CompositeFormatDetector
focal_class.var_name: detector
focal_class.file: dataprep-dataset/src/main/java/org/talend/dataprep/dataset/service/analysis/synchronous/FormatAnalysis.java
focal_class.identifier: FormatAnalysis
focal_class.interfaces: implements SynchronousDataSetAnalyzer
focal_class.class_method_signature: FormatAnalysis.analyze(String dataSetId)
focal_class.full_signature: @Override public void analyze(String dataSetId)
focal_class.identifier: analyze
focal_class.modifiers: @Override public
focal_class.parameters: (String dataSetId)
focal_class.return: void
focal_class.signature: void analyze(String dataSetId)
focal_class.class_method_signature: FormatAnalysis.verifyFormat(Format detectedFormat)
focal_class.full_signature: private void verifyFormat(Format detectedFormat)
focal_class.identifier: verifyFormat
focal_class.modifiers: private
focal_class.parameters: (Format detectedFormat)
focal_class.return: void
focal_class.signature: void verifyFormat(Format detectedFormat)
focal_class.class_method_signature: FormatAnalysis.internalUpdateMetadata(DataSetMetadata updatedMetadata, Format format)
focal_class.full_signature: private void internalUpdateMetadata(DataSetMetadata updatedMetadata, Format format)
focal_class.identifier: internalUpdateMetadata
focal_class.modifiers: private
focal_class.parameters: (DataSetMetadata updatedMetadata, Format format)
focal_class.return: void
focal_class.signature: void internalUpdateMetadata(DataSetMetadata updatedMetadata, Format format)
focal_class.class_method_signature: FormatAnalysis.update(DataSetMetadata original, DataSetMetadata updated)
focal_class.full_signature: public void update(DataSetMetadata original, DataSetMetadata updated)
focal_class.identifier: update
focal_class.modifiers: public
focal_class.parameters: (DataSetMetadata original, DataSetMetadata updated)
focal_class.return: void
focal_class.signature: void update(DataSetMetadata original, DataSetMetadata updated)
focal_class.class_method_signature: FormatAnalysis.parseColumnNameInformation(String dataSetId, DataSetMetadata metadata, Format format)
focal_class.full_signature: private void parseColumnNameInformation(String dataSetId, DataSetMetadata metadata, Format format)
focal_class.identifier: parseColumnNameInformation
focal_class.modifiers: private
focal_class.parameters: (String dataSetId, DataSetMetadata metadata, Format format)
focal_class.return: void
focal_class.signature: void parseColumnNameInformation(String dataSetId, DataSetMetadata metadata, Format format)
focal_class.class_method_signature: FormatAnalysis.order()
focal_class.full_signature: @Override public int order()
focal_class.identifier: order
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int order()
focal_class.class_method_signature: FormatAnalysis.addBOM(InputStream stream, byte[] bom)
focal_class.full_signature: private InputStream addBOM(InputStream stream, byte[] bom)
focal_class.identifier: addBOM
focal_class.modifiers: private
focal_class.parameters: (InputStream stream, byte[] bom)
focal_class.return: InputStream
focal_class.signature: InputStream addBOM(InputStream stream, byte[] bom)
focal_method.body: public void update(DataSetMetadata original, DataSetMetadata updated) {
  
          final Marker marker = Markers.dataset(updated.getId());
  
          FormatFamily formatFamily = formatFamilyFactory.getFormatFamily(original.getContent().getFormatFamilyId());
  
          if (!formatFamily.getSchemaGuesser().accept(updated)) {
              LOG.debug(marker, "the schema cannot be updated");
              return;
          }
  
          // update the schema
          Format format = new Format(formatFamily, updated.getEncoding());
          internalUpdateMetadata(updated, format);
  
          LOG.debug(marker, "format updated for dataset");
      }
focal_method.class_method_signature: FormatAnalysis.update(DataSetMetadata original, DataSetMetadata updated)
focal_method.full_signature: public void update(DataSetMetadata original, DataSetMetadata updated)
focal_method.identifier: update
focal_method.invocations: dataset getId getFormatFamily getFormatFamilyId getContent accept getSchemaGuesser debug getEncoding internalUpdateMetadata debug
focal_method.modifiers: public
focal_method.parameters: (DataSetMetadata original, DataSetMetadata updated)
focal_method.return: void
focal_method.signature: void update(DataSetMetadata original, DataSetMetadata updated)