public class FileName extends Object
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.
HtmlViewOptions,
LoadOptions,
Viewer| Modifier and Type | Field and Description |
|---|---|
static FileName |
EMPTY
Represents an empty filename.
|
static FileName |
SOURCE
Represents the name of the source file.
|
| Constructor and Description |
|---|
FileName(String fileName)
Initializes a new instance of the
FileName class. |
| Modifier and Type | Method and Description |
|---|---|
String |
getText() |
String |
toString()
Returns a string representation of the current object.
|
public static final FileName EMPTY
public static final FileName SOURCE
public FileName(String fileName)
Initializes a new instance of the FileName class.
fileName - The name of the file.Copyright © 2024. All rights reserved.