Package org.eclipse.xtend.lib.macro.file
Interface MutableFileSystemSupport
-
- All Superinterfaces:
FileSystemSupport
- All Known Subinterfaces:
CodeGenerationContext
@Beta public interface MutableFileSystemSupport extends FileSystemSupport
Allows modifications on the file system.- Noimplement:
- This interface is not intended to be implemented by clients.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description voiddelete(Path path)Deletes the file or folder the given path points to.voidmkdir(Path path)Deprecated.voidsetContents(Path path, java.lang.CharSequence contents)Writes the given contents to the given path.voidsetContentsAsStream(Path path, java.io.InputStream source)Sets the contents of this file to the bytes in the given input stream.-
Methods inherited from interface org.eclipse.xtend.lib.macro.file.FileSystemSupport
exists, getCharset, getChildren, getContents, getContentsAsStream, getLastModification, isFile, isFolder, toURI
-
-
-
-
Method Detail
-
setContents
void setContents(Path path, java.lang.CharSequence contents)
Writes the given contents to the given path. It will create the file if it doesn't exist, and create folders for all parents if they don't exist. Implementors may decide to perform this method asynchronously. Clients should not rely on invocation timing.- Parameters:
path- the path to write the contents tocontents- the contents of the file
-
setContentsAsStream
void setContentsAsStream(Path path, java.io.InputStream source)
Sets the contents of this file to the bytes in the given input stream. The stream will be closed after the operation has finished. Implementors may decide to perform this method asynchronously. Clients should not rely on invocation timing.- Parameters:
path- the path to the filesource- an input stream containing the new contents of the file
-
mkdir
@Deprecated void mkdir(Path path)
Deprecated.This method will be removed in future versions. Methods
Creates a directory for the given path and all its parents if necessary. Implementors may decide to perform this method asynchronously. Clients should not rely on invocation timing.setContents(org.eclipse.xtend.lib.macro.file.Path, java.lang.CharSequence)andsetContentsAsStream(Path, InputStream)create folders for all parents if they don't exist.- Parameters:
path- the path to the file- Since:
- 2.7
-
delete
void delete(Path path)
Deletes the file or folder the given path points to. If path points to a folder this method will also delete all its contents. Implementors may decide to perform this method asynchronously. Clients should not rely on invocation timing.- Parameters:
path-- Since:
- 2.7
-
-