11package org .biojava .nbio .structure .io .mmtf ;
22
33import java .io .IOException ;
4+ import java .nio .file .Path ;
45
56import org .biojava .nbio .structure .Structure ;
67import org .rcsb .mmtf .decoder .DefaultDecoder ;
1718public class MmtfActions {
1819
1920 /**
20- * Utility function to get a Biojava structure from a file.
21- * @param inputByteArray Must be uncompressed (i.e. with entropy compression methods like gzip)
22- * @return a Biojava structure object relating to the input byte array.
21+ * Utility function to get a Structure object from a mmtf file.
22+ * @param filePath the mmtf file
23+ * @return a Structure object relating to the input byte array.
2324 * @throws IOException
2425 */
25- public static Structure readFromFile (String filePath ) throws IOException {
26+ public static Structure readFromFile (Path filePath ) throws IOException {
2627 // Get the reader - this is the bit that people need to implement.
2728 MmtfStructureReader mmtfStructureReader = new MmtfStructureReader ();
2829 // Do the inflation
@@ -32,12 +33,12 @@ public static Structure readFromFile(String filePath) throws IOException {
3233 }
3334
3435 /**
35- * Utility function to write a Biojava structure object to a path .
36- * @param structure the structure to write
37- * @param path the full path of the file to write
36+ * Utility function to write a Structure object to a file .
37+ * @param structure the Structure to write
38+ * @param path the file to write
3839 * @throws IOException
3940 */
40- public static void writeToFile (Structure structure , String path ) throws IOException {
41+ public static void writeToFile (Structure structure , Path path ) throws IOException {
4142 // Set up this writer
4243 WriterToEncoder writerToEncoder = new WriterToEncoder ();
4344 // Get the writer - this is what people implement
@@ -48,9 +49,9 @@ public static void writeToFile(Structure structure, String path) throws IOExcept
4849
4950
5051 /**
51- * Utility function to get a Biojava structure from the REST service.
52+ * Utility function to get a Biojava structure from the mmtf REST service.
5253 * @param pdbId the PDB code of the required structure
53- * @return a Biojava structure object relating to the input byte array
54+ * @return a Structure object relating to the input byte array
5455 * @throws IOException
5556 */
5657 public static Structure readFromWeb (String pdbId ) throws IOException {
0 commit comments