Class MIFileUtils


  • public class MIFileUtils
    extends Object
    Utility class for Molecular interaction datasources
    Since:
    26/03/13
    Version:
    $Id$
    Author:
    Marine Dumousseau (marine@ebi.ac.uk)
    • Constructor Detail

      • MIFileUtils

        public MIFileUtils()
    • Method Detail

      • storeAsTemporaryFile

        public static File storeAsTemporaryFile​(InputStream is,
                                                String name,
                                                String extension)
                                         throws IOException
        Store the content of the given input stream into a temporary file and return its descriptor. It will not close the given input stream.
        Parameters:
        is - the input stream to store.
        name - a String object.
        extension - a String object.
        Returns:
        a File descriptor describing a temporary file storing the content of the given input stream.
        Throws:
        IOException - if an IO error occur.
      • storeAsTemporaryFile

        public static File storeAsTemporaryFile​(Reader reader,
                                                String name,
                                                String extension)
                                         throws IOException
        Store the content of the given reader into a temporary file and return its descriptor. It will not close the given reader.
        Parameters:
        reader - the reader to use.
        name - a String object.
        extension - a String object.
        Returns:
        a File descriptor describing a temporary file storing the content of the given input stream.
        Throws:
        IOException - if an IO error occur.