Top Description Methods
org.eclipse.xtend.lib.macro.file

public Interface MutableFileSystemSupport

extends FileSystemSupport
Known Direct Subinterfaces
org.eclipse.xtend.lib.macro.CodeGenerationContext
Annotations
@Beta
Imports
java.io.InputStream, com.google.common.annotations.Beta

Allows modifications on the file system.
Author
Sven Efftinge

Method Summary

Modifier and TypeMethod and Description
public void
delete(Path path)

Deletes the file or folder the given path points to.

public void
mkdir(Path
the path to the file
path
)
Deprecated

This method will be removed in future versions.

public void
setContents(Path
the path to write the contents to
path
,
CharSequence
the contents of the file
contents
)

Writes the given contents to the given path.

public void
setContentsAsStream(Path
the path to the file
path
,
InputStream
an input stream containing the new contents of the file
source
)

Sets the contents of this file to the bytes in the given input stream.

Inherited from org.eclipse.xtend.lib.macro.file.FileSystemSupport:
existsgetCharsetgetChildrengetContentsgetContentsAsStreamgetLastModificationisFileisFoldertoURI

Method Detail

deleteback to summary
public 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.

Since
2.7
mkdirback to summary
public void mkdir(Path path)

Deprecated

This method will be removed in future versions. Methods setContents and setContentsAsStream(Path, InputStream) create folders for all parents if they don't exist.

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.
Parameters
path:Path

the path to the file

Annotations
@Deprecated
Since
2.7
setContentsback to summary
public void setContents(Path path, 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:Path

the path to write the contents to

contents:CharSequence

the contents of the file

setContentsAsStreamback to summary
public void setContentsAsStream(Path path, 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:Path

the path to the file

source:InputStream

an input stream containing the new contents of the file