public class FileUtil extends Object
Constructor and Description |
---|
FileUtil() |
Modifier and Type | Method and Description |
---|---|
static String |
calculateWWWFileRelativePath(String path)
Calculates the physical path to the www folder according to a
FileConfig path . |
static void |
deletePortalFile(IFile portalFile)
Deletes portal file and all empty ancestor folders.
|
static void |
deletePortalFile(PortalFile portalFile)
Deprecated.
since 8.0.0 replaced by
deletePortalFile(IFile) |
static String |
getContentType(File file)
Deprecated.
since 8.0.0 replaced by
getContentType(IFile) . |
static String |
getContentType(IFile file)
Gets content type based on the given file.
|
static String |
getContentType(InputStream is,
String fileName)
Returns the content type based on the given file name and input stream.
|
static IResource |
getFileResource()
Returns the file resource.
|
static IWebsite |
getWebsiteByFile(FileConfig fileConfig,
ITransaction transaction)
Returns the website of the given file (the website that contains the file's service instance).
|
@Deprecated public static String getContentType(File file) throws IOException
getContentType(IFile)
.file
- the file.IOException
- if an IO error occured.public static String getContentType(InputStream is, String fileName) throws IOException
is
- the input stream.fileName
- the file name.IOException
public static String getContentType(IFile file) throws IOException
file
- the file.IOException
public static String calculateWWWFileRelativePath(String path)
FileConfig path
.path
- the path stored in the FileConfig
.@Deprecated public static void deletePortalFile(PortalFile portalFile)
deletePortalFile(IFile)
portalFile
- the file
to be deleted.public static void deletePortalFile(IFile portalFile) throws FileNotFoundException, FileCouldNotBeDeletedException, IOException
portalFile
- the file
to be deleted.FileNotFoundException
FileCouldNotBeDeletedException
IOException
public static IWebsite getWebsiteByFile(FileConfig fileConfig, ITransaction transaction) throws ManagerException, PortalException
fileConfig
- the file.transaction
- the transaction.ManagerException
PortalException
public static IResource getFileResource()
LumisXP 12.3.0.200408 - Copyright © 2006–2020 Lumis EIP Tecnologia da Informação LTDA. All Rights Reserved.