public abstract class TextResourceBase extends Object implements IHtmlResource
Base class for any supported text resource with text content and encoding
Modifier and Type | Field and Description |
---|---|
com.aspose.ms.lang.Event<com.aspose.ms.System.EventHandler> |
Disposed |
Constructor and Description |
---|
TextResourceBase(String name,
com.aspose.ms.System.IO.Stream binaryContent,
com.aspose.ms.System.Text.Encoding originalEncoding) |
TextResourceBase(String name,
String textualContent,
com.aspose.ms.System.Text.Encoding originalEncoding) |
Modifier and Type | Method and Description |
---|---|
void |
dispose()
Disposes this text resource, disposing its content and making most
methods and properties non-working
|
boolean |
equals(IHtmlResource other)
Checks this instance with specified on equality.
|
InputStream |
getByteContent()
Returns content of this text resource as byte stream with original
encoding
|
com.aspose.ms.System.IO.Stream |
getByteContentInternal() |
Charset |
getEncoding()
Returns encoding of this textual resource.
|
com.aspose.ms.System.Text.Encoding |
getEncodingInternal() |
String |
getFilenameWithExtension()
Returns correct filename of this text resource, which consists of name
and extension
|
String |
getName()
Returns name of this text resource without file extension
|
String |
getTextContent()
Returns content of this text resource as a standard string
|
abstract TextType |
getType()
In implementing type should return information about type of the text
resource
|
boolean |
isDisposed()
Determines whether this text resource is disposed or not
|
void |
save(String fullPathToFile)
Saves this text resource to the specified file
|
public final com.aspose.ms.lang.Event<com.aspose.ms.System.EventHandler> Disposed
public TextResourceBase(String name, com.aspose.ms.System.IO.Stream binaryContent, com.aspose.ms.System.Text.Encoding originalEncoding)
public final void dispose()
Disposes this text resource, disposing its content and making most methods and properties non-working
dispose
in interface com.aspose.ms.System.IDisposable
public final boolean equals(IHtmlResource other)
Checks this instance with specified on equality.
other
- Other HTML resource of unknown type, that is also presumable
TextResourceBase inheritorpublic final InputStream getByteContent()
Returns content of this text resource as byte stream with original encoding
getByteContent
in interface IHtmlResource
public com.aspose.ms.System.IO.Stream getByteContentInternal()
getByteContentInternal
in interface IHtmlResource
public final Charset getEncoding()
Returns encoding of this textual resource. Usually returns UTF-8.
public com.aspose.ms.System.Text.Encoding getEncodingInternal()
public final String getFilenameWithExtension()
Returns correct filename of this text resource, which consists of name and extension
getFilenameWithExtension
in interface IHtmlResource
public final String getName()
Returns name of this text resource without file extension
getName
in interface IHtmlResource
public final String getTextContent()
Returns content of this text resource as a standard string
getTextContent
in interface IHtmlResource
public abstract TextType getType()
In implementing type should return information about type of the text resource
getType
in interface IHtmlResource
public final boolean isDisposed()
Determines whether this text resource is disposed or not
isDisposed
in interface IAuxDisposable
public final void save(String fullPathToFile)
Saves this text resource to the specified file
save
in interface IHtmlResource
fullPathToFile
- Full path to the file, which will be created or
rewritten if already exists