Package org.xwiki.vfs
Class VfsResourceReference
- java.lang.Object
-
- org.xwiki.resource.AbstractResourceReference
-
- org.xwiki.resource.entity.EntityResourceReference
-
- org.xwiki.vfs.VfsResourceReference
-
- All Implemented Interfaces:
ResourceReference
public class VfsResourceReference extends org.xwiki.resource.entity.EntityResourceReference
Represents a reference to a VFS resource.- Since:
- 7.4M2
- Version:
- $Id: 32862047c555a94d9f7a94a3d8f8d6bb744c3e9b $
-
-
Field Summary
Fields Modifier and Type Field Description static ResourceType
TYPE
Represents a VFS Resource Type.
-
Constructor Summary
Constructors Constructor Description VfsResourceReference(String fullReference)
VfsResourceReference(URI fullURI)
Deprecated.Since 12.4RC1, this constructor shouldn't be used anymore, in particular not for internal references such asattach:space.page@attachment/path/to/file
,VfsResourceReference(String)
should be used insteadVfsResourceReference(URI uri, String pathSegments)
VfsResourceReference(URI uri, List<String> pathSegments)
VfsResourceReference(VfsResourceReference reference)
Create a new reference by copying the passed one.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
equals(Object object)
String
getContentType()
String
getPath()
List<String>
getPathSegments()
String
getReference()
String
getScheme()
URI
getURI()
Deprecated.Since 12.4RC1 this method shouldn't be used anymore, in favor ofgetReference()
.int
hashCode()
void
setContentType(String contentType)
String
toString()
URI
toURI()
-
Methods inherited from class org.xwiki.resource.entity.EntityResourceReference
getAction, getEntityReference, getLocale, getRevision, setAction, setEntityReference, setLocale, setRevision
-
Methods inherited from class org.xwiki.resource.AbstractResourceReference
addParameter, getParameters, getParameterValue, getParameterValues, getType, setParameter, setType
-
-
-
-
Field Detail
-
TYPE
public static final ResourceType TYPE
Represents a VFS Resource Type.
-
-
Constructor Detail
-
VfsResourceReference
@Unstable public VfsResourceReference(VfsResourceReference reference)
Create a new reference by copying the passed one.- Parameters:
reference
- the reference to copy- Since:
- 12.3RC1
-
VfsResourceReference
public VfsResourceReference(URI uri, List<String> pathSegments)
- Parameters:
uri
- the URI pointing to the archive (without the path inside the archive), e.g.attach:space.page@attachment
pathSegments
- seegetPathSegments()
-
VfsResourceReference
public VfsResourceReference(URI uri, String pathSegments)
- Parameters:
uri
- the URI pointing to the archive (without the path inside the archive), e.g.attach:space.page@attachment
pathSegments
- seegetPathSegments()
, specified as "/"-separated string (e.g. "path/to/file")
-
VfsResourceReference
@Deprecated public VfsResourceReference(URI fullURI)
Deprecated.Since 12.4RC1, this constructor shouldn't be used anymore, in particular not for internal references such asattach:space.page@attachment/path/to/file
,VfsResourceReference(String)
should be used instead- Parameters:
fullURI
- the full opaque URI containing both the reference to the archive and the path to the entry inside it, e.g.attach:space.page@attachment/path/to/file
. Note that this constructor requires that the full URL to be URL-encoded.
-
VfsResourceReference
public VfsResourceReference(String fullReference)
- Parameters:
fullReference
- the full opaque reference containing both the reference to the archive and the path to the entry inside it, e.g.attach:space.page@attachment/path/to/file
.- Since:
- 12.4RC1
-
-
Method Detail
-
getURI
@Deprecated public URI getURI()
Deprecated.Since 12.4RC1 this method shouldn't be used anymore, in favor ofgetReference()
.- Returns:
- the URI to the VFS (e.g.
attach:space.page@file.zip
,http://server/path/to/zip
)
-
getReference
public String getReference()
- Returns:
- the actual reference to the VFS (e.g.
attach:space.page@file.zip
). - Since:
- 12.4RC1
-
getScheme
public String getScheme()
- Returns:
- the scheme of this reference (e.g.
attach
). - Since:
- 12.4RC1
-
getPathSegments
public List<String> getPathSegments()
- Returns:
- the list of segments pointing to the relative location of a resource in the VFS (e.g.
{"some", "directory", "file.txt"}
forsome/directory/file.txt
-
getPath
public String getPath()
- Returns:
- the String representation with "/" separating each VFS path segment, e.g.
some/directory/file.txt
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classorg.xwiki.resource.entity.EntityResourceReference
-
equals
public boolean equals(Object object)
- Overrides:
equals
in classorg.xwiki.resource.entity.EntityResourceReference
-
toString
public String toString()
- Overrides:
toString
in classorg.xwiki.resource.entity.EntityResourceReference
-
toURI
public URI toURI()
- Returns:
- the resource reference as a URI
-
getContentType
public String getContentType()
- Returns:
- the Content-Type to return with the response
- Since:
- 12.3RC1
-
setContentType
public void setContentType(String contentType)
- Parameters:
contentType
- the Content-Type to return with the response- Since:
- 12.3RC1
-
-