@SingletonDefault(implFor=FileService.class) public class FileServiceImpl extends Object implements FileService
| Constructor and Description |
|---|
FileServiceImpl() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
assertValidChmod(int chmod) |
File |
chmod(int chmod,
File file)
Performs a chmod-like operation on a file.
|
File |
createTempDir(String prefix,
boolean deleteOnExit) |
void |
delete(String kill,
boolean recursive) |
String |
getFileMaybeUnzip(String file,
int chmod) |
String |
getPath(String path)
Return the canonical (fully resolved) path of the given path segment.
|
String |
getResourceMaybeUnzip(String resource,
ClassLoader cl,
int chmod) |
protected static boolean |
isHexadecimalChmod(int chmod)
This test is an APPROXIMATION of whether a given integer is hexadecimal,
and is used only in an assertion statement warding off malformed permissions.
|
void |
mkdirsTransient(File dest) |
boolean |
saveFile(String path,
String fileName,
String contents) |
boolean |
saveFile(String path,
String fileName,
String contents,
String charset) |
String |
unzip(String resource,
JarFile jarFile,
int chmod) |
public File chmod(int chmod, File file)
FileServicePosixFilePermission.
A method may be provided to translate decimal input,
but for now, there is an assertion guarding this method.chmod in interface FileServicechmod - - A HEXADECIMAL value < 0x777file - - The file to apply the setting uponpublic void delete(String kill, boolean recursive)
delete in interface FileServicepublic File createTempDir(String prefix, boolean deleteOnExit)
createTempDir in interface FileServicepublic String getPath(String path)
FileServicegetPath in interface FileServicepublic String getFileMaybeUnzip(String file, int chmod)
getFileMaybeUnzip in interface FileServicepublic String getResourceMaybeUnzip(String resource, ClassLoader cl, int chmod)
getResourceMaybeUnzip in interface FileServicepublic boolean saveFile(String path, String fileName, String contents)
saveFile in interface FileServicepublic boolean saveFile(String path, String fileName, String contents, String charset)
saveFile in interface FileServicepublic String unzip(String resource, JarFile jarFile, int chmod)
unzip in interface FileServiceprotected void assertValidChmod(int chmod)
protected static boolean isHexadecimalChmod(int chmod)
chmod - - The chmod value to checkpublic void mkdirsTransient(File dest)
mkdirsTransient in interface FileServiceCopyright © December 07, 2012–2015 The Internet Party. All rights reserved.