public final class PSDocument extends PSURI implements PSEntity
DEFAULT_HOST, DEFAULT_PORT, DEFAULT_SCHEME, MAX_PORT_NUMBER
Constructor and Description |
---|
PSDocument(String url)
Construct a new document from the specified URL.
|
PSDocument(String scheme,
String host,
int port,
String path)
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
EntityValidity |
checkValid()
Known constraints on Member are based on SQL definition:
|
String |
getFilename() |
static String |
getFilename(String url)
Returns the filename from the path or URL.
|
static String |
getFolder(String url)
Returns the folder path from the path or URL.
|
String |
getFolderURL() |
String |
getType() |
boolean |
isValid()
Determines whether the entity is valid based on known PageSeeder constraints.
|
void |
setFilename(String filename) |
void |
setType(String type) |
String |
toString() |
checkURIValid, getCreatedDate, getDescription, getDisplayTitle, getDocid, getId, getIdentifier, getKey, getLabels, getLabelsAsString, getMediaType, getModifiedDate, getTitle, isIdentifiable, setCreatedDate, setDescription, setDocid, setId, setLabels, setLabels, setMediaType, setModifiedDate, setTitle
getHost, getHostURL, getPath, getPort, getScheme, getURL, setHost, setPath, setPort, setScheme, toURL
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getId, getIdentifier, getKey, isIdentifiable
public PSDocument(String url)
The URL may omit the scheme or authority part, it which case it will default on the default values from the configuration.
Implementation note: this constructor will decompose the URL into its components.
url
- The URL to the document.IllegalArgumentException
- If the specified URL is invalidpublic String getFilename()
public String getFolderURL()
public String getType()
public void setFilename(String filename)
filename
- the filename to setpublic void setType(String type)
type
- the type to setpublic EntityValidity checkValid()
DocID VARCHAR(100) NULL, Scheme VARCHAR(20) CHARACTER SET ascii NULL, Path VARCHAR(500) CHARACTER SET ascii NULL, HostID INTEGER NULL, Port INTEGER NULL, Title VARCHAR(250) NULL, Behavior VARCHAR(80) NULL, LastModified DATETIME NULL, Description TEXT NULL, UserTitle VARCHAR(250) NULL, Type VARCHAR(100) NULL, Status VARCHAR(40) NULL, Labels VARCHAR(250) NULL,Determines whether this object is valid based on known PageSeeder constraints.
checkValid
in interface PSEntity
true
if the object is intrinsically valid based on its internal values;
false
if any of its attributes violates a PageSeeder constraint.public boolean isValid()
PSEntity
public static String getFilename(String url)
url
- The path or URLCopyright © 2016 Allette Systems. All rights reserved.