FileName

Inheritance: java.lang.Object

public class FileName

Represents the name of a file in an archive.

The FileName class encapsulates the name of a file without any path or directory information. It provides methods to manipulate and retrieve information about the file name.

Example usage:


 HtmlViewOptions options = HtmlViewOptions.forEmbeddedResources();
 options.getArchiveOptions().setFileName(new FileName("my-file-name"));

 final LoadOptions loadOptions = new LoadOptions(FileType.ZIP);
 try (final Viewer viewer = new Viewer(documentPath, loadOptions)) {
     viewer.view(options);
     // Use the viewer object for archive document rendering
 }
 

Note: The FileName class is used to work with file names and does not handle file operations or manipulation.

Constructors

Constructor Description
FileName(String fileName) Initializes a new instance of the FileName class.

Fields

Field Description
EMPTY Represents an empty filename.
SOURCE Represents the name of the source file.

Methods

Method Description
getText()
toString() Returns a string representation of the current object.

FileName(String fileName)

public FileName(String fileName)

Initializes a new instance of the FileName class.

Parameters:

Parameter Type Description
fileName java.lang.String The name of the file.

EMPTY

public static final FileName EMPTY

Represents an empty filename.

SOURCE

public static final FileName SOURCE

Represents the name of the source file.

getText()

public String getText()

Returns: java.lang.String

toString()

public String toString()

Returns a string representation of the current object.

Returns: java.lang.String - a string representation of the current object.