Nio File

public final class NioFile implements File

Constructors

Link copied to clipboard
public NioFile NioFile(NioDirectory nioParent, Path path, NioFileSystem fileSystem)

Types

Link copied to clipboard
public final class NioFileOutputStream extends FilterOutputStream

Functions

Link copied to clipboard
public Unit create()

Creates this entity. The meaning of creation depends on the filesystem implementation. Regardless of the implementation, after using create the result of exists must be true

Link copied to clipboard
public Unit delete()

Deletes this entity. The meaning of deletion depends on the filesystem implementation. Regardless of the implementation, after using delete the result of exists must be false

Link copied to clipboard
public Boolean equals(Object other)
Link copied to clipboard
public Boolean exists()

Returns if this entity exists or not.

Link copied to clipboard
public String getName()

Returns the name of this entity.

Link copied to clipboard

The parent of this child if there is one. If parent is null that means this object is the root object of the parent-child chain

Link copied to clipboard
public String getPath(Character separator)

Returns the path representation of this entity. Each entity in the path is separated with the separator. The path returned by this method without changing the separator can be used with Directory.getDirectory or Directory.getFile on the root directory of the filesystem to get this entity again.

Link copied to clipboard
public Integer hashCode()
Link copied to clipboard

Opens a new InputStream to read from the file.

Link copied to clipboard
public OutputStream openWrite(Boolean append)

Opens an OutputStream to write to this file. The stream can either replace the existing content or append the data at the end of the file

Link copied to clipboard
public Long size()

Returns the size of this entity. The size may be different for different kinds of entities. Entities should return -1 if exists returns false

Properties

Link copied to clipboard
private final Directory parent

The parent of this child if there is one. If parent is null that means this object is the root object of the parent-child chain