abstract class AbstractAssetFile
This is the base Asset File specification class. An AssetFile object should extend this abstract base class. The AssetFile specification provides information on what processors need to be run on a file. A file is matched to an AssetFile specification based on its content type and extension. If a file is not matched to a processable AssetFile entity, see the GenericAssetFile.
Type | Name and description |
---|---|
AssetFile |
baseFile If this file was loaded as a sub dependency of a parent file this property will contain that baseFile reference This is useful for recalculating base path relative uri patterns within the file. |
byte[] |
byteCache |
MessageDigest |
digest |
DigestInputStream |
digestStream |
Pattern |
directivePattern |
String |
encoding The encoding of the file, typically injected by the DirectiveProcessor If unspecified, the OS default is assumed |
Closure |
inputStreamSource |
List<String> |
matchedDirectives |
String |
path |
AssetResolver |
sourceResolver The relevant AssetResolver that was used to find the instance of this file |
Type | Name and description |
---|---|
String |
getByteDigest() Returns a HEX encoded byte digest of the file contents (preprocessed) This leverages the DigestStream wrapping the files inputStream for efficient calculation If the stream is not fully read yet it will consume the rest of the stream |
String |
getCanonicalPath() Returns the canonicalPath in the context of the AssetResolver file path structure. |
Pattern |
getDirectivePattern() Returns the directive pattern used to perform bundling in the comments of the file it is possible for the pattern to be NULL if this file type does not support it |
InputStream |
getInputStream() Executes the inputStreamSource() closure to fetch a new inputStream object In the case of a standard asset file this result is cached into a Byte Array and also wrapped in a DigestInputStream for efficient md5 digest generation |
String |
getName() Returns the name of the file without the path elements |
String |
getParentPath() Gets the parent path of the file Behaves similarly to a File.getParent() method @return |
String |
processedStream(AssetCompiler precompiler, Boolean skipCaching = false) Returns a Processed String of the files contents This includes a run through of all Processors in the processors List. |
String |
toString() String representation of the object defaults to the full path of the file @return |
If this file was loaded as a sub dependency of a parent file this property will contain that baseFile reference This is useful for recalculating base path relative uri patterns within the file.
The encoding of the file, typically injected by the DirectiveProcessor If unspecified, the OS default is assumed
The relevant AssetResolver that was used to find the instance of this file
Returns a HEX encoded byte digest of the file contents (preprocessed) This leverages the DigestStream wrapping the files inputStream for efficient calculation If the stream is not fully read yet it will consume the rest of the stream
Returns the canonicalPath in the context of the AssetResolver file path structure. (this is not the real filesystem canonical path)
Returns the directive pattern used to perform bundling in the comments of the file it is possible for the pattern to be NULL if this file type does not support it
Executes the inputStreamSource() closure to fetch a new inputStream object In the case of a standard asset file this result is cached into a Byte Array and also wrapped in a DigestInputStream for efficient md5 digest generation
Returns the name of the file without the path elements
Gets the parent path of the file Behaves similarly to a File.getParent() method
Returns a Processed String of the files contents This includes a run through of all Processors in the processors List. The precompiler object is passed to all processors as well as determines the behavior of the runtime cache manager.
precompiler
- reference to the active compiler being used (If NULL development mode is assumed)skipCaching
- defaults to false. Optional flag for forcing a cache skip.String representation of the object defaults to the full path of the file