Class ContentFileObjectUtils

java.lang.Object
org.onehippo.forge.content.exim.core.util.ContentFileObjectUtils

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

    Modifier and Type
    Method
    Description
    static org.apache.commons.vfs2.FileObject
    createTempFile(String prefix, String suffix)
    Create a temporary file by prefix and suffix and returns it as a FileObject.
    static org.apache.commons.vfs2.FileObject
    createTempFile(String prefix, String suffix, org.apache.commons.vfs2.FileObject directory)
    Create a temporary file by prefix and suffix under directory and returns it as a FileObject.
    static File
    toFile(org.apache.commons.vfs2.FileObject fileObject)
    Converts fileObject to a File instance and return it if fileObject is a local file.
    static org.apache.commons.vfs2.FileObject
    Creates a FileObject from the give local File object (file).

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • 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