Class ContentFileObjectUtils


  • public class ContentFileObjectUtils
    extends Object
    ContentFileObjectUtils providing utilities for FileObject and File.
    • Method Detail

      • createTempFile

        public static org.apache.commons.vfs2.FileObject createTempFile​(String prefix,
                                                                        String suffix)
                                                                 throws IOException
        Create a temporary file by prefix and suffix and returns it as a FileObject.
        Parameters:
        prefix - temporary file prefix
        suffix - temporary file suffix
        Returns:
        a temporary file by prefix and suffix and returns it as a FileObject
        Throws:
        IOException - if IOException occurs
      • createTempFile

        public static org.apache.commons.vfs2.FileObject createTempFile​(String prefix,
                                                                        String suffix,
                                                                        org.apache.commons.vfs2.FileObject directory)
                                                                 throws IOException
        Create a temporary file by prefix and suffix under directory and returns it as a FileObject.
        Parameters:
        prefix - temporary file prefix
        suffix - temporary file suffix
        directory - base directory
        Returns:
        a temporary file by prefix and suffix and returns it as a FileObject
        Throws:
        IOException - if IOException occurs
      • toFile

        public static File toFile​(org.apache.commons.vfs2.FileObject fileObject)
                           throws IOException
        Converts fileObject to a File instance and return it if fileObject is a local file.
        Parameters:
        fileObject - FileObject instance
        Returns:
        Converts fileObject to a File instance and return it if fileObject is a local file
        Throws:
        IOException - if fileObject is not a local file or any IOException occurs
      • toFileObject

        public static org.apache.commons.vfs2.FileObject toFileObject​(File file)
                                                               throws IOException
        Creates a FileObject from the give local File object (file).
        Parameters:
        file - a local File object
        Returns:
        a FileObject from the give local File object (file)
        Throws:
        IOException - if any IOException occurs