Package net.simplace.core.service
Class FilePathHelper
java.lang.Object
net.simplace.core.service.FilePathHelper
Resource manager for FilePaths. Should be used allways to access the Filesystem
can be used for getting Temp-Dir (Unique while software is run), Cache-Dir (Unique per user)
and Random Temp-Dir (allways unique). All folders are situated in java.io.tmpdir/IMPETUS.
- Author:
- Andreas Enders
-
Method Summary
Modifier and TypeMethodDescriptionReturns the Cache used for all sessions of this JavaVM.float
getCacheVersion
(String aSystemID, String aFileName, String aTargetDir) static FilePathHelper
Get Singleton instance of FilePathLocator.static File
getRandomFile
(String aFileName) Returns the Tempfile used for only this call.Returns a Random Tempdir used for only this session of the JavaVM.static File
getResourcePath
(File aFile) Returns the Tempdir used for only this session of the JavaVM.Returns the Tempdir used for all sessions of this JavaVM.getTempFile
(String aFileName) Returns the Tempfile used for only this call.boolean
Removes the whole tempdir.boolean
Removes the session - tempdir.void
setNewCacheVersion
(String aSystemID, String aFileName, String aTargetDir, float aVersion) setTempDirRoot
(String aFilePath) Returns the aFilePath used for all sessions of this JavaVM.
-
Method Details
-
getInstance
Get Singleton instance of FilePathLocator.- Returns:
- Singleton instance of FilePathLocator
-
getTempDirRoot
Returns the Tempdir used for all sessions of this JavaVM.- Returns:
- the Tempdir used for all sessions of this JavaVM
-
setTempDirRoot
Returns the aFilePath used for all sessions of this JavaVM.- Parameters:
aFilePath
-- Returns:
- the aFilePath used for all sessions of this JavaVM
-
getTempDir
Returns the Tempdir used for only this session of the JavaVM.- Returns:
- the Tempdir used for only this session of the JavaVM
-
getRandomTempDir
Returns a Random Tempdir used for only this session of the JavaVM.- Returns:
- a Random Tempdir used for only this session of the JavaVM
-
getCacheDir
Returns the Cache used for all sessions of this JavaVM.- Returns:
- the Cache used for all sessions of this JavaVM
-
setNewCacheVersion
public void setNewCacheVersion(String aSystemID, String aFileName, String aTargetDir, float aVersion) - Parameters:
aSystemID
-aFileName
-aTargetDir
-aVersion
-aI
-
-
getCacheVersion
- Parameters:
aSystemID
-aFileName
-aTargetDir
-- Returns:
- a cache version
-
getRandomFile
Returns the Tempfile used for only this call.- Parameters:
aFileName
-- Returns:
- the Tempfile used for only this call
-
getTempFile
Returns the Tempfile used for only this call.- Parameters:
aFileName
-- Returns:
- the Tempfile used for only this call
- Throws:
IOException
-
removeTempDir
public boolean removeTempDir()Removes the session - tempdir.- Returns:
- success
-
removeAllClientTempDirs
public boolean removeAllClientTempDirs()Removes the whole tempdir.- Returns:
- success
-
getLogFile
- Returns:
- Log file
-
getResourcePath
- Parameters:
aFile
-- Returns:
- Resource path
-