public interface IMutableFileRelativeIO extends IFileRelativeIO
IFileRelativeIO interface. It extends the
base interface with writable methods relative to a certain directory.| 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) |
default com.helger.commons.io.file.FileIOError |
deleteDirectory(String sDirName,
boolean bDeleteRecursively) |
com.helger.commons.io.file.FileIOError |
deleteDirectoryIfExisting(File fDir,
boolean bDeleteRecursively) |
default com.helger.commons.io.file.FileIOError |
deleteDirectoryIfExisting(String sDirName,
boolean bDeleteRecursively) |
com.helger.commons.io.file.FileIOError |
deleteFile(File aFile) |
default com.helger.commons.io.file.FileIOError |
deleteFile(String sFilename) |
com.helger.commons.io.file.FileIOError |
deleteFileIfExisting(File aFile) |
default com.helger.commons.io.file.FileIOError |
deleteFileIfExisting(String sFilename) |
default OutputStream |
getOutputStream(String sRelativePath)
Get the
OutputStream relative to the base path. |
default OutputStream |
getOutputStream(String sRelativePath,
com.helger.commons.io.EAppend eAppend)
Get the
OutputStream relative to the base path |
default Writer |
getWriter(String sRelativePath,
Charset aCharset)
Get the
Writer relative to the base path. |
default 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.
|
existsDir, existsFile, getBasePath, getBasePathFile, getFile, getRelativeFilename, getResourcegetInputStream, getReader@Nullable default 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 writableIFileRelativeIO.getBasePathFile()@Nullable default 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 writableIFileRelativeIO.getBasePathFile()@Nullable default 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 writableIFileRelativeIO.getBasePathFile()@Nullable default 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 writableIFileRelativeIO.getBasePathFile()@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.IFileRelativeIO.getBasePathFile()@Nonnull default com.helger.commons.io.file.FileIOError deleteFile(@Nonnull String sFilename)
@Nonnull default com.helger.commons.io.file.FileIOError deleteFileIfExisting(@Nonnull String sFilename)
@Nonnull com.helger.commons.io.file.FileIOError deleteFileIfExisting(@Nonnull File aFile)
@Nonnull default 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 default 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–2017 Philip Helger. All rights reserved.