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

public Interface FileSystemSupport

Known Direct Subinterfaces
org.eclipse.xtend.lib.macro.file.MutableFileSystemSupport, org.eclipse.xtend.lib.macro.RegisterGlobalsContext, org.eclipse.xtend.lib.macro.TransformationContext, org.eclipse.xtend.lib.macro.ValidationContext
Annotations
@Beta
Imports
java.io.InputStream, java.net.URI, com.google.common.annotations.Beta

Support for accessing the file system.
Authors
Anton Kosyakov, Sven Efftinge

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

whether the given path points to an existent file.
exists
(Path
the path
path
)

public String

Returns:

the name of a charset
getCharset
(Path
the path
path
)

Returns the name of a charset to be used when decoding the contents of this file into characters.

public Iterable<? extends Path>

Returns:

the children of the folder the given path points to; empty iterable if the path points to a non existent file or folder
getChildren
(Path path)

public CharSequence

Returns:

an input stream containing the contents of the file
getContents
(Path
the path
path
)

Returns the contents of this file as a char sequence.

public InputStream

Returns:

an input stream containing the contents of the file
getContentsAsStream
(Path
the path
path
)

Returns an open input stream on the contents of this file.

public long

Returns:

A long value representing the time the file was last modified, measured in milliseconds since the epoch (00:00:00 GMT, January 1, 1970), or 0L if the file does not exist.
getLastModification
(Path path)

public boolean

Returns:

whether the given path points to an existent file
isFile
(Path path)

public boolean

Returns:

whether the given path points to an existent folder
isFolder
(Path path)

public URI

Returns:

the URI representing the given path or null if the path points to a non existent file or a folder.
toURI
(Path
the path
path
)

Returns the URI representing the given path.

Method Detail

existsback to summary
public boolean exists(Path path)
Parameters
path:Path

the path

Returns:boolean

whether the given path points to an existent file.

getCharsetback to summary
public String getCharset(Path path)

Returns the name of a charset to be used when decoding the contents of this file into characters.

Parameters
path:Path

the path

Returns:String

the name of a charset

Exceptions
IllegalArgumentException:
if it is not possible to get charset of a given path for some reason
getChildrenback to summary
public Iterable<? extends Path> getChildren(Path path)
Returns:Iterable<? extends Path>

the children of the folder the given path points to; empty iterable if the path points to a non existent file or folder

Exceptions
IllegalArgumentException:
if it is not possible to get children of a given path for some reason
getContentsback to summary
public CharSequence getContents(Path path)

Returns the contents of this file as a char sequence.

Parameters
path:Path

the path

Returns:CharSequence

an input stream containing the contents of the file

Exceptions
IllegalArgumentException:
if the path points to a non existent file
getContentsAsStreamback to summary
public InputStream getContentsAsStream(Path path)

Returns an open input stream on the contents of this file.

Parameters
path:Path

the path

Returns:InputStream

an input stream containing the contents of the file

Exceptions
IllegalArgumentException:
if the path points to a non existent file
getLastModificationback to summary
public long getLastModification(Path path)
Returns:long

A long value representing the time the file was last modified, measured in milliseconds since the epoch (00:00:00 GMT, January 1, 1970), or 0L if the file does not exist.

isFileback to summary
public boolean isFile(Path path)
Returns:boolean

whether the given path points to an existent file

isFolderback to summary
public boolean isFolder(Path path)
Returns:boolean

whether the given path points to an existent folder

toURIback to summary
public URI toURI(Path path)

Returns the URI representing the given path.

Warning

Don't use this method to get write access.

Parameters
path:Path

the path

Returns:URI

the URI representing the given path or null if the path points to a non existent file or a folder.