|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnl.uva.vlet.vrs.VNode
nl.uva.vlet.vrs.ResourceNode
public abstract class ResourceNode
Super Class of LinkNode and ServerInfo. The ResourceNode describes a resource, which can be a Link or a Server. Instead of being the resource (File,Directory) itself, like VFile and VDir. the ResourceNode has a 'Target' which is the linked-to resource or the Remote Server. For example a LinkNode can be stored in as a VFile (.vlink) but the physical resource type of the LinkNode stays a VFile. When the LinkNode is loaded it becomes a ResourceNode. This delayed or lazy type of loading makes it possible for the VBrowser to optimize the link resolving, thus only load/resolve a link when really needed. TODO: Integration with ServerInfo
Field Summary | |
---|---|
static java.lang.String |
ATTR_LINK_IS_COMPOSITE
Hidden hint to quickly know whether target is composite |
static java.lang.String |
ATTR_LINK_MIMETYPE
Hidden attribute: mimetype of linkTarget. |
static boolean |
default_show_shortcut_icon
Default value when not specified |
protected static java.lang.String[] |
guiAttributeNames
extra link attributes |
protected VComposite |
parent
Optional parent for in-memory resourceNode (=logical parent) |
protected VAttributeSet |
resourceAttributes
Link Attributes, also used to store 'extra' or Server Attributes ! The names of these attributes are stored in serverAttributeNames. |
static java.lang.String |
SERVER_ATTRIBUTES
Hidden server Attributes Names |
protected java.lang.String[] |
serverAttributeNames
|
protected VNode |
storageLocation
The location where this ResourceNode is stored. |
protected java.lang.String |
type
|
protected static java.lang.String[] |
urlAttributeNames
|
Fields inherited from class nl.uva.vlet.vrs.VNode |
---|
ATTR_CHARSET, ATTR_HOSTNAME, ATTR_ICON, ATTR_ISVLINK, ATTR_LOCATION, ATTR_MIMETYPE, ATTR_NAME, ATTR_PATH, ATTR_PORT, ATTR_SCHEME, ATTR_TYPE, location, vrsContext |
Constructor Summary | |
---|---|
ResourceNode(VRSContext context,
VRL vrl)
|
Method Summary | |
---|---|
protected void |
_loadFrom(java.io.InputStream inps)
|
protected void |
_loadFrom(VNode vnode)
Load data from (VStreamReadable) VNode |
protected void |
checkAndStoreNewServerInfo()
|
protected void |
copyFrom(ResourceNode source)
Duplicate: Initializer |
boolean |
delete()
Delete specified resource. |
boolean |
exists()
A ResourcNode is an already resolved node (data object) in memory so as an 'object' it already exists. |
VAttribute |
getAttribute(java.lang.String name)
This is the single method a Node has to implement so that attributes can be fetched. |
java.lang.String[] |
getAttributeNames()
Get the names of the attributes this resource has |
java.lang.String |
getIconURL()
Returns optional icon url, used by VBrowser |
VNode |
getImplementation()
the VNode which stores the LinkNode object, usually a VFile |
java.io.InputStream |
getInputStream()
Create InputStream to read from this (remote) resource. |
java.lang.String |
getName()
Returns the short name of the resource. The default is the basename of the resource or the last part of the path part in the URI. |
VNode |
getParent()
Returns 'Logical' Parent. |
ServerInfo |
getServerInfo()
Return ServerInfo stored in this ResourceNode |
boolean |
getShowShortCutIcon()
|
java.lang.String |
getTargetHostname()
|
boolean |
getTargetIsComposite()
Checks whether remote resource is composite or not. |
java.lang.String |
getTargetMimeType()
Returns mimetype of link target |
java.lang.String |
getTargetPath()
|
int |
getTargetPort()
|
java.lang.String |
getTargetScheme()
|
java.lang.String |
getTargetType()
|
java.lang.String |
getTargetUserInfo()
Returns username + (optional) domainname added the to userinfo. |
java.lang.String |
getTargetUsername()
This method returns the username without optional domain name info. |
VRL |
getTargetVRL()
Returns linkTarget location |
java.lang.String |
getType()
Returns resource type, if it has one |
protected void |
init(VRL logicalVRL,
VRL targetVRL,
boolean resolveLink)
|
protected void |
initAttributes()
|
boolean |
isDeletable()
returns true is the caller has the permissions to delete this resource The default implementation for a VFSNode is to check whether it is writable |
boolean |
isEditable()
returns true is the caller has the permissions to edit this resource. |
boolean |
isRenamable()
Returns true is the resource is renamble whit the current credentials. |
boolean |
isServerType()
|
boolean |
isVirtual()
New Generic Type for MyVLe and LinkNodes |
boolean |
renameTo(java.lang.String newName,
boolean nameIsPath)
Renames this resource. Since for some implementations ( java.io.File ) a full path
is needed. |
void |
save()
|
boolean |
setAttribute(VAttribute attr)
Set single attribute. |
boolean |
setAttribute(VAttribute attr,
boolean store)
|
boolean |
setAttributes(VAttribute[] attrs)
Sets a list of attributes |
boolean |
setAttributes(VAttribute[] attrs,
boolean store)
|
void |
setIconURL(java.lang.String url)
sets setIconURL of this linknode |
void |
setName(java.lang.String val)
|
protected void |
setResourceVRL(VRL linkTarget)
|
protected void |
setServerAttributeNames(java.lang.String[] attrNames)
|
void |
setServerAttributes(VAttribute[] attributes)
Sets server properties to store in link object, this will OVERIDE other old value of server properties! |
void |
setServerInfo(ServerInfo info)
Set ServerInfo to be stored in this ResourceNode |
void |
setShowShortCutIcon(boolean b)
|
void |
setTargetHostname(java.lang.String val)
|
protected void |
setTargetPath(java.lang.String val)
|
protected void |
setTargetPort(int val)
|
protected void |
setTargetScheme(java.lang.String scheme)
|
void |
setTargetUsername(java.lang.String val)
Since the username is OPTIONAL setting this value to null will remove the username attribute from the linktarget attribute list, so it will not appear in the Attribute list ! (When doing a getAttributes() for example). |
protected void |
setType(java.lang.String type)
|
protected boolean |
updateTargetAttributes()
Update stored Target Attributes: isComposite. |
Methods inherited from class nl.uva.vlet.vrs.VNode |
---|
compareTo, getAttributes, getAttributes, getAttributeSet, getBasename, getCharSet, getHelp, getHostname, getID, getLocation, getMimeType, getParents, getPath, getPort, getScheme, getServerAttributes, getURI, getVRL, getVRSContext, isComposite, isVLink, mergedGetAttributes, setLocation, setVRL, toLinkNode, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String ATTR_LINK_MIMETYPE
public static final java.lang.String SERVER_ATTRIBUTES
public static final java.lang.String ATTR_LINK_IS_COMPOSITE
public static final boolean default_show_shortcut_icon
protected static java.lang.String[] urlAttributeNames
protected static java.lang.String[] guiAttributeNames
protected VAttributeSet resourceAttributes
protected java.lang.String[] serverAttributeNames
protected VComposite parent
protected VNode storageLocation
protected java.lang.String type
Constructor Detail |
---|
public ResourceNode(VRSContext context, VRL vrl)
Method Detail |
---|
protected void copyFrom(ResourceNode source)
protected void init(VRL logicalVRL, VRL targetVRL, boolean resolveLink) throws VlException
VlException
protected void initAttributes()
public java.lang.String getType()
VNode
getType
in class VNode
protected void setType(java.lang.String type)
public java.lang.String getName()
VNode
getName
in class VNode
public boolean exists()
exists
in class VNode
public VNode getParent() throws VlException
getParent
in class VNode
VlException
VNode.getParents()
public boolean isVirtual()
VNode
isVirtual
in class VNode
public boolean isEditable() throws VlException
VEditable
isEditable
in interface VEditable
VlException
public boolean isDeletable() throws VlException
VEditable
isDeletable
in interface VEditable
VlException
public void setTargetHostname(java.lang.String val)
protected void setTargetPort(int val)
public void setTargetUsername(java.lang.String val)
val
- public java.lang.String getTargetType()
protected void setTargetPath(java.lang.String val)
protected void setTargetScheme(java.lang.String scheme)
public void save() throws VlException
VlException
public VNode getImplementation()
public void setIconURL(java.lang.String url)
public java.lang.String getTargetMimeType()
public java.lang.String getIconURL()
getIconURL
in class VNode
public boolean isServerType()
public void setShowShortCutIcon(boolean b)
public boolean getShowShortCutIcon()
public boolean setAttributes(VAttribute[] attrs, boolean store) throws VlException
VlException
public boolean setAttributes(VAttribute[] attrs) throws VlException
VEditable
setAttributes
in interface VEditable
VlException
public boolean setAttribute(VAttribute attr) throws VlException
VEditable
setAttribute
in interface VEditable
VlException
public boolean setAttribute(VAttribute attr, boolean store) throws VlException
VlException
public ServerInfo getServerInfo()
public void setServerInfo(ServerInfo info)
public void setServerAttributes(VAttribute[] attributes)
protected void setServerAttributeNames(java.lang.String[] attrNames)
public void setName(java.lang.String val)
public boolean renameTo(java.lang.String newName, boolean nameIsPath) throws VlException
VRenamable
java.io.File
) a full path
is needed. The parameter nameIsPath specifies whether only
the basename (last part of path) or the full path is given
as new name to avoid this ambiguoty !
renameTo
in interface VRenamable
newName
- New basename or fullpath of new filenamenameIsPath
- whether the 'name' is an absolute path
VlException
public boolean isRenamable() throws VlException
VRenamable
isRenamable
in interface VRenamable
VlException
VFSNode.isRenamable();
public java.lang.String getTargetScheme()
public int getTargetPort()
public java.lang.String getTargetUsername()
public java.lang.String getTargetUserInfo() throws VlException
VlException
public java.lang.String getTargetHostname()
public java.lang.String getTargetPath()
public boolean getTargetIsComposite() throws VlException
resolve
-
VlException
protected boolean updateTargetAttributes()
public VRL getTargetVRL() throws VlException
VlException
protected void setResourceVRL(VRL linkTarget)
protected void _loadFrom(VNode vnode) throws VlException
VlException
protected void _loadFrom(java.io.InputStream inps) throws VlException
VlException
public VAttribute getAttribute(java.lang.String name) throws VlException
VNode
getAttribute
in class VNode
VlException
public boolean delete() throws VlException
VEditable
delete
in interface VEditable
VlException
public java.lang.String[] getAttributeNames()
VNode
getAttributeNames
in class VNode
protected void checkAndStoreNewServerInfo() throws VlException
VlException
public java.io.InputStream getInputStream() throws VlException
VStreamReadable
Note that not all protocols support 'partially' reading from a remote file. Currently both Jargon's SRB and Java's File type support Input and OutputStreams !
getInputStream
in interface VStreamReadable
VlException
InputStream
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |