format/src/main/java/com/github/sadikovi/riff/Metadata.java
/**
     * Write metadata file in output location. If output location is directory - file is created in
     * that directory, otherwise file is created at the same level as outputPath file.
     * @param outputPath path to the output directory or file
     */
Write metadata file in output location. If output location is directory - file is created in
that directory, otherwise file is created at the same level as outputPath file.
@param outputPath path to the output directory or file
Write metadata file in output location . If output location is directory - file is created in that directory otherwise file is created at the same level as outputPath file . @param outputPath path to the output directory or file
public void writeMetadataFile(Path outputPath) throws IOException {
      FileStatus status = fs.getFileStatus(outputPath);
      Path parent = status.isDirectory() ? status.getPath() : status.getPath().getParent();
      FSDataOutputStream out = null;
      try {
        Path metadataPath = new Path(parent, METADATA_FILENAME);
        out = fs.create(metadataPath, false);
        metadata.writeTo(out);
      } finally {
        if (out != null) {
          out.close();
        }
      }
    }
public void writeMetadataFile ( Path outputPath ) throws IOException { FileStatus status = fs . getFileStatus ( outputPath ) ; Path parent = status . isDirectory ( ) ? status . getPath ( ) : status . getPath ( ) . getParent ( ) ; FSDataOutputStream out = null ; try { Path metadataPath = new Path ( parent , METADATA_FILENAME ) ; out = fs . create ( metadataPath , false ) ; metadata . writeTo ( out ) ; } finally { if ( out != null ) { out . close ( ) ; } } }
Write metadata file in output location.
Write metadata file in output location .