Class FileUtil

java.lang.Object
org.vrspace.server.core.FileUtil

public class FileUtil extends Object
  • Constructor Details

    • FileUtil

      public FileUtil()
  • Method Details

    • downloadDir

      public static File downloadDir()
      Returns location of downloads directory: either Downloads under user home directory if exists, or system temporary directory
    • contentDir

      public static String contentDir()
      Returns absolute name of content directory. Public access.
    • uploadDir

      public static String uploadDir()
      Returns absolute name of uploaded content directory, public access.
    • attachmentDir

      public static String attachmentDir()
      Returns absolute name of attachment directory. Attachments must not be accessible over the web, but only through web API to authorized users.
    • unzip

      public static Path unzip(File file, File dir) throws IOException
      Unzip a file to a directory
      Parameters:
      file - zip to unzip
      dir - where to
      Returns:
      newly created directory containing extracted files
      Throws:
      IOException - if anything goes wrong