|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.dna.web.jcr.rest.client.json.JsonRestClient
public final class JsonRestClient
The JsonRestClient
class is an implementation of IRestClient
that works with the DNA REST server that
uses JSON as its interface protocol.
Constructor Summary | |
---|---|
JsonRestClient()
|
Method Summary | |
---|---|
Collection<Repository> |
getRepositories(Server server)
Obtains the DNA repositories defined within the specified server. |
URL |
getUrl(File file,
String path,
Workspace workspace)
|
Collection<Workspace> |
getWorkspaces(Repository repository)
Obtains the workspaces defined within the specified DNA respository. |
boolean |
pathExists(Workspace workspace,
String path,
File file)
|
Status |
publish(Workspace workspace,
String path,
File file)
Publishes, or uploads, a local file to the workspace at the specified path. |
Status |
unpublish(Workspace workspace,
String path,
File file)
Unpublishes, or deletes, the resource at the specified path in the workspace. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JsonRestClient()
Method Detail |
---|
public Collection<Repository> getRepositories(Server server) throws Exception
getRepositories
in interface IRestClient
server
- the server whose repositories are being requested (never null
)
null
)
Exception
- if there is a problem obtaining the repositoriesIRestClient.getRepositories(org.jboss.dna.web.jcr.rest.client.domain.Server)
public URL getUrl(File file, String path, Workspace workspace) throws Exception
getUrl
in interface IRestClient
file
- the file whose URL is being requested (never null
)path
- the path in the DNA workspace where the file is/could be located (never null
)workspace
- the workspace where the file is/could be located (never null
)
null
)
Exception
- if there is a problem obtaining the URL or if the file is a directoryIRestClient.getUrl(java.io.File, java.lang.String,
org.jboss.dna.web.jcr.rest.client.domain.Workspace)
public Collection<Workspace> getWorkspaces(Repository repository) throws Exception
getWorkspaces
in interface IRestClient
repository
- the repository whose workspaces are being requested (never null
)
null
)
Exception
- if there is a problem obtaining the workspacesIRestClient.getWorkspaces(org.jboss.dna.web.jcr.rest.client.domain.Repository)
public boolean pathExists(Workspace workspace, String path, File file) throws Exception
workspace
- the workspace being checked (never null
)path
- the path in workspace (never null
)file
- the file being checked (never null
)
true
if the file exists in the workspace at the specified path
Exception
- if there is a problem checking the existence of the filepublic Status publish(Workspace workspace, String path, File file)
publish
in interface IRestClient
workspace
- the workspace where the resource will be published (never null
)path
- the unencoded path to the folder where the file will be published (never null
)file
- the resource being published (never null
)
null
)IRestClient.publish(org.jboss.dna.web.jcr.rest.client.domain.Workspace,
java.lang.String, java.io.File)
public Status unpublish(Workspace workspace, String path, File file)
info status
is returned.
unpublish
in interface IRestClient
workspace
- the workspace where the resource will be unpublished (never null
)path
- the unencoded path to the folder where the file is published (never null
)file
- the file being unpublished (never null
)
null
)IRestClient.unpublish(org.jboss.dna.web.jcr.rest.client.domain.Workspace,
java.lang.String, java.io.File)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |