Entity

public interface Entity

An Entity represents an object within a filesystem. An Entity can be a file or a directory or other distinct objects that share the same properties and basic functionalities

Functions

Link copied to clipboard
public abstract 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 abstract 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 abstract Boolean exists()

Returns if this entity exists or not.

Link copied to clipboard
public abstract String getName()

Returns the name of this entity.

Link copied to clipboard
public abstract 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 abstract 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

Inheritors

Link copied to clipboard
Link copied to clipboard