public interface IPathRelativeIO
| Modifier and Type | Method and Description |
|---|---|
com.helger.commons.state.ESuccess |
appendFile(String sFilename,
byte[] aBytes)
Helper function for saving a file with correct error handling.
|
com.helger.commons.state.ESuccess |
appendFile(String sFilename,
String sContent,
Charset aCharset)
Helper function for saving a file with correct error handling.
|
com.helger.commons.io.file.FileIOError |
createDirectory(String sRelativePath,
boolean bRecursive)
Create the appropriate directory if it is not existing
|
com.helger.commons.io.file.FileIOError |
deleteDirectory(File fDir,
boolean bDeleteRecursively) |
com.helger.commons.io.file.FileIOError |
deleteDirectory(String sDirName,
boolean bDeleteRecursively) |
com.helger.commons.io.file.FileIOError |
deleteDirectoryIfExisting(File fDir,
boolean bDeleteRecursively) |
com.helger.commons.io.file.FileIOError |
deleteDirectoryIfExisting(String sDirName,
boolean bDeleteRecursively) |
com.helger.commons.io.file.FileIOError |
deleteFile(File aFile) |
com.helger.commons.io.file.FileIOError |
deleteFile(String sFilename) |
com.helger.commons.io.file.FileIOError |
deleteFileIfExisting(File aFile) |
com.helger.commons.io.file.FileIOError |
deleteFileIfExisting(String sFilename) |
boolean |
existsDir(String sRelativePath)
Check if a directory relative to the base path exists
|
boolean |
existsFile(String sRelativePath)
Check if a file relative to the base path exists
|
String |
getBasePath() |
File |
getBasePathFile() |
File |
getFile(String sRelativePath)
Get a
File relative to the base path. |
InputStream |
getInputStream(String sRelativePath)
Get the
InputStream relative to the base path |
OutputStream |
getOutputStream(String sRelativePath)
Get the
OutputStream relative to the base path. |
OutputStream |
getOutputStream(String sRelativePath,
com.helger.commons.io.EAppend eAppend)
Get the
OutputStream relative to the base path |
Reader |
getReader(String sRelativePath,
Charset aCharset)
Get the
Reader relative to the base path |
String |
getRelativeFilename(File aAbsoluteFile)
Get the relative file name for the passed absolute file.
|
com.helger.commons.io.resource.FileSystemResource |
getResource(String sRelativePath)
Get the file system resource relative to the base path
|
Writer |
getWriter(String sRelativePath,
Charset aCharset)
Get the
Writer relative to the base path. |
Writer |
getWriter(String sRelativePath,
Charset aCharset,
com.helger.commons.io.EAppend eAppend)
Get the
Writer relative to the base path. |
com.helger.commons.io.file.FileIOError |
renameDir(String sOldDirName,
String sNewDirName) |
com.helger.commons.io.file.FileIOError |
renameFile(String sOldFilename,
String sNewFilename) |
com.helger.commons.state.ESuccess |
saveFile(String sFilename,
byte[] aBytes)
Helper function for saving a file with correct error handling.
|
com.helger.commons.state.ESuccess |
saveFile(String sFilename,
String sContent,
Charset aCharset)
Helper function for saving a file with correct error handling.
|
@Nonnull @Nonempty String getBasePath()
null nor
empty.@Nonnull File getFile(@Nonnull String sRelativePath)
File relative to the base path.sRelativePath - the relative pathFile and never null.getBasePathFile()boolean existsFile(@Nonnull String sRelativePath)
sRelativePath - the relative pathtrue if the File is a file and exists,
false otherwise.getBasePathFile()boolean existsDir(@Nonnull String sRelativePath)
sRelativePath - the relative pathtrue if the File is a directory and exists,
false otherwise.getBasePathFile()@Nonnull com.helger.commons.io.resource.FileSystemResource getResource(@Nonnull String sRelativePath)
sRelativePath - the relative pathFileSystemResource and never
null.getBasePathFile()@Nullable InputStream getInputStream(@Nonnull String sRelativePath)
InputStream relative to the base pathsRelativePath - the relative pathnull if the path does not existgetBasePathFile()@Nullable Reader getReader(@Nonnull String sRelativePath, @Nonnull Charset aCharset)
Reader relative to the base pathsRelativePath - the relative pathaCharset - The charset to use. May not be null.null if the path does not existgetBasePathFile()@Nullable OutputStream getOutputStream(@Nonnull String sRelativePath)
OutputStream relative to the base path. An eventually
existing file is truncated.sRelativePath - the relative pathnull if the path is not writablegetBasePathFile()@Nullable OutputStream getOutputStream(@Nonnull String sRelativePath, @Nonnull com.helger.commons.io.EAppend eAppend)
OutputStream relative to the base pathsRelativePath - the relative patheAppend - Append or truncate mode. May not be null.null if the path is not writablegetBasePathFile()@Nullable Writer getWriter(@Nonnull String sRelativePath, @Nonnull Charset aCharset)
Writer relative to the base path. An eventually existing
file is truncated.sRelativePath - the relative pathaCharset - The charset to use. May not be null.null if the path is not writablegetBasePathFile()@Nullable Writer getWriter(@Nonnull String sRelativePath, @Nonnull Charset aCharset, @Nonnull com.helger.commons.io.EAppend eAppend)
Writer relative to the base path.sRelativePath - the relative pathaCharset - The charset to use. May not be null.eAppend - Append or truncate mode. May not be null.null if the path is not writablegetBasePathFile()@Nonnull com.helger.commons.io.file.FileIOError createDirectory(@Nonnull String sRelativePath, boolean bRecursive)
sRelativePath - the relative pathbRecursive - if true all missing parent directories will be creatednull.getBasePathFile()@Nonnull com.helger.commons.io.file.FileIOError deleteFileIfExisting(@Nonnull String sFilename)
@Nonnull com.helger.commons.io.file.FileIOError deleteFileIfExisting(@Nonnull File aFile)
@Nonnull com.helger.commons.io.file.FileIOError deleteDirectory(@Nonnull String sDirName, boolean bDeleteRecursively)
@Nonnull com.helger.commons.io.file.FileIOError deleteDirectory(@Nonnull File fDir, boolean bDeleteRecursively)
@Nonnull com.helger.commons.io.file.FileIOError deleteDirectoryIfExisting(@Nonnull String sDirName, boolean bDeleteRecursively)
@Nonnull com.helger.commons.io.file.FileIOError deleteDirectoryIfExisting(@Nonnull File fDir, boolean bDeleteRecursively)
@Nonnull com.helger.commons.io.file.FileIOError renameFile(@Nonnull String sOldFilename, @Nonnull String sNewFilename)
@Nonnull com.helger.commons.io.file.FileIOError renameDir(@Nonnull String sOldDirName, @Nonnull String sNewDirName)
@Nonnull com.helger.commons.state.ESuccess saveFile(@Nonnull String sFilename, @Nonnull String sContent, @Nonnull Charset aCharset)
sFilename - name of the file. May not be null.sContent - the content to save. May not be null.aCharset - The character set to use. May not be null.ESuccess@Nonnull com.helger.commons.state.ESuccess saveFile(@Nonnull String sFilename, byte[] aBytes)
sFilename - name of the file. May not be null.aBytes - the bytes to be written. May not be null.ESuccess@Nonnull com.helger.commons.state.ESuccess appendFile(@Nonnull String sFilename, @Nonnull String sContent, @Nonnull Charset aCharset)
sFilename - name of the file. May not be null.sContent - the content to save. May not be null.aCharset - The character set to use. May not be null.ESuccess@Nonnull com.helger.commons.state.ESuccess appendFile(@Nonnull String sFilename, @Nonnull byte[] aBytes)
sFilename - name of the file. May not be null.aBytes - the bytes to be written. May not be null.ESuccessCopyright © 2014–2015 Philip Helger. All rights reserved.