Class WAbstractDataInfo
- Direct Known Subclasses:
WDataInfo,WWebRootDataInfo
This is an abstract class which is meant to store/compute information about a resource/file. Its primary use is to map URIs to file paths. This is to avoid confusion when rendering out these resources, so that depending on the context the resources is created under, locating the file correctly happens.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the data in data URI format.Returns a path to a file containing the data.getName()Returns the name of the Data.getUrl()Returns the URL of the data.booleanReturns whether this can return the data in data URI format.booleanReturns whether this contains a path to a file.booleanhasUrl()Returns whether this contains a URL.
-
Constructor Details
-
WAbstractDataInfo
public WAbstractDataInfo()
-
-
Method Details
-
getFilePath
Returns a path to a file containing the data.This returns a path to a file containing the data. This should point to a path that exists on the system.
By default this will throw an exception.
Warning: If you reimplement this function, you must also reimplement
hasFilePath()- See Also:
-
getUrl
Returns the URL of the data.This returns the URL of the data. This can be both an absolute URL or a URL relative to the application's base URL.
By default this will throw an exception.
Warning: If you reimplement this function, you must also reimplement
hasUrl()- See Also:
-
getDataUri
Returns the data in data URI format.This returns the data in data URI format (see: https://developer.mozilla.org/en-US/docs/Web/URI/Reference/Schemes/data).
By default this will throw an exception.
Warning: If you reimplement this function, you must also reimplement
hasDataUri()- See Also:
-
getName
Returns the name of the Data.This returns the name of the data. This is mainly use for error reporting.
By default this will return
getUrl()ifhasUrl()istrue. In case it isfalse, it will returngetFilePath()ifhasFilePath()istrue, and it will return an empty string otherwise. -
hasFilePath
public boolean hasFilePath()Returns whether this contains a path to a file.This returns whether filePath returns a path to a file containing the data.
By default this returns
false.- See Also:
-
hasUrl
public boolean hasUrl()Returns whether this contains a URL.This returns whether
getUrl()returns a URL of the data.By default this returns
false.- See Also:
-
hasDataUri
public boolean hasDataUri()Returns whether this can return the data in data URI format.This returns whether
getDataUri()returns the data in data URI format.By default this returns
false.- See Also:
-