Class FileUtil
- java.lang.Object
-
- de.uplanet.lucy.server.auxiliaries.FileUtil
-
@VelocityVariable("FileUtil") @VelocityCallable("singleton") public final class FileUtil extends Object
-
-
Constructor Summary
Constructors Constructor Description FileUtil()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
exists(String p_strPath)
Checks if the given path references a file system object within the portal.VMFileInfo
getFileInfo(de.uplanet.lucy.server.IProcessingContext p_ctx, IValueHolder<?> p_vh, String p_strPageGuid, String p_strControlName)
Path
getIconPathOfKnownFileExtension(String p_strFileName)
String
getIconUrlOfKnownFileExtension(String p_strFileName)
String
getKnownFileExtension(String p_strFileName)
List<String>
getKnownFileExtensions()
Returns the known Intrexx file extensions.boolean
hasFileExtension(Object p_object, String p_strSuffix)
Check if the given object has the given suffix.boolean
hasFileExtension(Object p_object, List<String> p_patterns)
Check if the given object has one of the given the given suffixes.boolean
isDirectory(String p_strPath)
Checks if the given path references a directory within the portal.boolean
isFile(String p_strPath)
Checks if the given path references a file within the portal.
-
-
-
Method Detail
-
exists
public boolean exists(String p_strPath)
Checks if the given path references a file system object within the portal.- Parameters:
p_strPath
- The path.- Returns:
true
if the given path references a file system object within the portal, orfalse
otherwise.- Throws:
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.- Parameters:
p_strPath
- The file path.- Returns:
true
if the given path references a file within the portal, orfalse
otherwise.- Throws:
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.- Parameters:
p_strPath
- The directory path.- Returns:
true
if the given path references a directory within the portal, orfalse
otherwise.- Throws:
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.
- Parameters:
p_object
- The object (e.g. string, file, or path).p_strSuffix
- The file extension.- Returns:
true
if the object has the given suffix, orfalse
otherwise.- Throws:
IllegalArgumentException
- If the given object isnull
.
-
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.
- Parameters:
p_object
- The object (e.g. string, file, or path).p_patterns
- A list of file extensions (suffixes).- Returns:
true
if the object has one of the given suffixes, orfalse
otherwise.- Throws:
IllegalArgumentException
- If the given object isnull
.
-
getFileInfo
public VMFileInfo getFileInfo(de.uplanet.lucy.server.IProcessingContext p_ctx, IValueHolder<?> p_vh, String p_strPageGuid, String p_strControlName) throws Exception
- Throws:
Exception
-
getKnownFileExtensions
public List<String> getKnownFileExtensions()
Returns the known Intrexx file extensions.- Returns:
- List of known file extensions
-
getKnownFileExtension
public String getKnownFileExtension(String p_strFileName)
- Parameters:
p_strFileName
- The file name- Returns:
- The known file extension, if a extension not known, "unknown" will returned.
-
-