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(PortalFile portalFile)
Deletes portal file and all empty ancestor folders.
|
static String |
getContentType(File file)
Gets content type based on the given file.
|
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).
|
public static String getContentType(File file) throws IOException
file
- the file.IOException
- if an IO error occured.public static String calculateWWWFileRelativePath(String path)
FileConfig path
.path
- the path stored in the FileConfig
.public static void deletePortalFile(PortalFile portalFile)
portalFile
- the file
to be deleted.public static IWebsite getWebsiteByFile(FileConfig fileConfig, ITransaction transaction) throws ManagerException, PortalException
fileConfig
- the file.transaction
- the transaction.ManagerException
PortalException
public static IResource getFileResource()
Lumisportal 7.1.1.140331 - Copyright © 2006–2014 Lumis EIP Tecnologia da Informação LTDA. All Rights Reserved.