Klasse FileUtil

java.lang.Object
de.uplanet.lucy.server.auxiliaries.FileUtil

@VelocityVariable("FileUtil") @VelocityCallable("singleton") public final class FileUtil extends Object
  • Konstruktordetails

    • FileUtil

      public FileUtil()
  • Methodendetails

    • exists

      public boolean exists(String p_strPath)
      Checks if the given path references a file system object within the portal.
      Parameter:
      p_strPath - The path.
      Gibt zurück:
      true if the given path references a file system object within the portal, or false otherwise.
      Löst aus:
      SecurityException - If the given path references a file system object outside the portal.
    • isFile

      public boolean isFile(String p_strPath)
      Checks if the given path references a file within the portal.
      Parameter:
      p_strPath - The file path.
      Gibt zurück:
      true if the given path references a file within the portal, or false otherwise.
      Löst aus:
      SecurityException - If the given path references a file outside the portal.
    • isDirectory

      public boolean isDirectory(String p_strPath)
      Checks if the given path references a directory within the portal.
      Parameter:
      p_strPath - The directory path.
      Gibt zurück:
      true if the given path references a directory within the portal, or false otherwise.
      Löst aus:
      SecurityException - If the given path references a directory outside the portal.
    • hasFileExtension

      public boolean hasFileExtension(Object p_object, String p_strSuffix)
      Check if the given object has the given suffix.

      Note that for file extensions the dot has to be included in the pattern.

      The internal comparison is lower-case.

      Parameter:
      p_object - The object (e.g. string, file, or path).
      p_strSuffix - The file extension.
      Gibt zurück:
      true if the object has the given suffix, or false otherwise.
      Löst aus:
      IllegalArgumentException - If the given object is null.
    • hasFileExtension

      public boolean hasFileExtension(Object p_object, List<String> p_patterns)
      Check if the given object has one of the given the given suffixes.

      Note that for file extensions the dot has to be included in the patterns.

      The internal comparison is lower-case.

      Parameter:
      p_object - The object (e.g. string, file, or path).
      p_patterns - A list of file extensions (suffixes).
      Gibt zurück:
      true if the object has one of the given suffixes, or false otherwise.
      Löst aus:
      IllegalArgumentException - If the given object is null.
    • getFileInfo

      public VMFileInfo getFileInfo(de.uplanet.lucy.server.IProcessingContext p_ctx, IValueHolder<?> p_vh, String p_strPageGuid, String p_strControlName) throws Exception
      Löst aus:
      Exception
    • getKnownFileExtensions

      public List<String> getKnownFileExtensions()
      Returns the known Intrexx file extensions.
      Gibt zurück:
      List of known file extensions
    • getKnownFileExtension

      public String getKnownFileExtension(String p_strFileName)
      Parameter:
      p_strFileName - The file name
      Gibt zurück:
      The known file extension, if a extension not known, "unknown" will returned.
    • getIconUrlOfKnownFileExtension

      public String getIconUrlOfKnownFileExtension(String p_strFileName)
    • getIconPathOfKnownFileExtension

      public Path getIconPathOfKnownFileExtension(String p_strFileName)
      Parameter:
      p_strFileName - The file name.
      Gibt zurück:
      Returns the path to content type icon for the file. The path will be relative to the portal root directory.