/** * @see org.springframework.extensions.webscripts.ScriptContent#getPathDescription() */ public String getPathDescription() { return getStorePath() + '/' + this.scriptPath + " loaded from endpoint: " + getEndpoint(); }
/** * @see org.springframework.extensions.webscripts.ScriptContent#getPathDescription() */ public String getPathDescription() { return getStorePath() + '/' + this.scriptPath + " loaded from endpoint: " + getEndpoint(); }
/** * @see org.springframework.extensions.webscripts.ScriptContent#getPathDescription() */ public String getPathDescription() { return getStorePath() + '/' + this.scriptPath + " loaded from endpoint: " + getEndpoint(); }
public void createDocument(String documentPath, String content) throws IOException { ByteArrayInputStream in = new ByteArrayInputStream(content.getBytes("UTF-8")); Response res = callPost(buildEncodeCall(API_CREATE, documentPath), in); if (logger.isDebugEnabled()) logger.debug("RemoteStore.createDocument() " + documentPath + " = " + res.getStatus().getCode()); if (Status.STATUS_OK != res.getStatus().getCode()) { throw new IOException("Unable to create document path: " + documentPath + " in remote store: " + this.getEndpoint() + " due to error: " + res.getStatus().getCode() + " " + res.getStatus().getMessage()); } }
public void updateDocument(String documentPath, String content) throws IOException { ByteArrayInputStream in = new ByteArrayInputStream(content.getBytes("UTF-8")); Response res = callPost(buildEncodeCall(API_UPDATE, documentPath), in); if (logger.isDebugEnabled()) logger.debug("RemoteStore.updateDocument() " + documentPath + " = " + res.getStatus().getCode()); if (Status.STATUS_OK != res.getStatus().getCode()) { throw new IOException("Unable to update document path: " + documentPath + " in remote store: " + this.getEndpoint() + " due to error: " + res.getStatus().getCode() + " " + res.getStatus().getMessage()); } }
public void updateDocument(String documentPath, String content) throws IOException { ByteArrayInputStream in = new ByteArrayInputStream(content.getBytes("UTF-8")); Response res = callPost(buildEncodeCall(API_UPDATE, documentPath), in); if (logger.isDebugEnabled()) logger.debug("RemoteStore.updateDocument() " + documentPath + " = " + res.getStatus().getCode()); if (Status.STATUS_OK != res.getStatus().getCode()) { throw new IOException("Unable to update document path: " + documentPath + " in remote store: " + this.getEndpoint() + " due to error: " + res.getStatus().getCode() + " " + res.getStatus().getMessage()); } }
public void createDocument(String documentPath, String content) throws IOException { ByteArrayInputStream in = new ByteArrayInputStream(content.getBytes("UTF-8")); Response res = callPost(buildEncodeCall(API_CREATE, documentPath), in); if (logger.isDebugEnabled()) logger.debug("RemoteStore.createDocument() " + documentPath + " = " + res.getStatus().getCode()); if (Status.STATUS_OK != res.getStatus().getCode()) { throw new IOException("Unable to create document path: " + documentPath + " in remote store: " + this.getEndpoint() + " due to error: " + res.getStatus().getCode() + " " + res.getStatus().getMessage()); } }
public void updateDocument(String documentPath, String content) throws IOException { ByteArrayInputStream in = new ByteArrayInputStream(content.getBytes("UTF-8")); Response res = callPost(buildEncodeCall(API_UPDATE, documentPath), in); if (logger.isDebugEnabled()) logger.debug("RemoteStore.updateDocument() " + documentPath + " = " + res.getStatus().getCode()); if (Status.STATUS_OK != res.getStatus().getCode()) { throw new IOException("Unable to update document path: " + documentPath + " in remote store: " + this.getEndpoint() + " due to error: " + res.getStatus().getCode() + " " + res.getStatus().getMessage()); } }
public void createDocument(String documentPath, String content) throws IOException { ByteArrayInputStream in = new ByteArrayInputStream(content.getBytes("UTF-8")); Response res = callPost(buildEncodeCall(API_CREATE, documentPath), in); if (logger.isDebugEnabled()) logger.debug("RemoteStore.createDocument() " + documentPath + " = " + res.getStatus().getCode()); if (Status.STATUS_OK != res.getStatus().getCode()) { throw new IOException("Unable to create document path: " + documentPath + " in remote store: " + this.getEndpoint() + " due to error: " + res.getStatus().getCode() + " " + res.getStatus().getMessage()); } }
/** * Get a Connector for access to the endpoint. If a connector has been bound to the * current thread then use it, else retrieve a transient connector instance from the * ConnectorService. * * @return Connector * * @throws ConnectorProviderException */ protected Connector getConnector() throws ConnectorProviderException { Connector conn = null; // use a default connector provider if none injected if (connectorProvider == null) { connectorProvider = new ConnectorProviderImpl(); } // provision connector conn = getConnectorProvider().provide(this.getEndpoint()); return conn; }
/** * Get a Connector for access to the endpoint. If a connector has been bound to the * current thread then use it, else retrieve a transient connector instance from the * ConnectorService. * * @return Connector * * @throws ConnectorProviderException */ protected Connector getConnector() throws ConnectorProviderException { Connector conn = null; // use a default connector provider if none injected if (connectorProvider == null) { connectorProvider = new ConnectorProviderImpl(); } // provision connector conn = getConnectorProvider().provide(this.getEndpoint()); return conn; }
public long lastModified(String documentPath) throws IOException { Response res = callGet(buildEncodeCall(API_LASTMODIFIED, documentPath)); if (Status.STATUS_OK == res.getStatus().getCode()) { try { long lastMod = Long.parseLong(res.getResponse()); if (logger.isDebugEnabled()) logger.debug("RemoteStore.lastModified() " + documentPath + " = " + lastMod); return lastMod; } catch (NumberFormatException ne) { throw new IOException("Failed to process lastModified response: " + ne.getMessage()); } } else { throw new IOException("Unable to get lastModified date of document path: " + documentPath + " in remote store: " + this.getEndpoint() + " due to error: " + res.getStatus().getCode() + " " + res.getStatus().getMessage()); } }
/** * Get a Connector for access to the endpoint. If a connector has been bound to the * current thread then use it, else retrieve a transient connector instance from the * ConnectorService. * * @return Connector * * @throws RemoteConfigException */ protected Connector getConnector() throws ConnectorProviderException { Connector conn = null; // use a default connector provider if none injected if (connectorProvider == null) { connectorProvider = new ConnectorProviderImpl(); } // provision connector conn = getConnectorProvider().provide(this.getEndpoint()); return conn; }
public long lastModified(String documentPath) throws IOException { Response res = callGet(buildEncodeCall(API_LASTMODIFIED, documentPath)); if (Status.STATUS_OK == res.getStatus().getCode()) { try { long lastMod = Long.parseLong(res.getResponse()); if (logger.isDebugEnabled()) logger.debug("RemoteStore.lastModified() " + documentPath + " = " + lastMod); return lastMod; } catch (NumberFormatException ne) { throw new IOException("Failed to process lastModified response: " + ne.getMessage()); } } else { throw new IOException("Unable to get lastModified date of document path: " + documentPath + " in remote store: " + this.getEndpoint() + " due to error: " + res.getStatus().getCode() + " " + res.getStatus().getMessage()); } }
public boolean hasDocument(String documentPath) throws IOException { boolean hasDocument = false; Response res = callGet(buildEncodeCall(API_HAS, documentPath)); if (Status.STATUS_OK == res.getStatus().getCode()) { hasDocument = Boolean.parseBoolean(res.getResponse()); } else { throw new IOException("Unable to test document path: " + documentPath + " in remote store: " + this.getEndpoint() + " due to error: " + res.getStatus().getCode() + " " + res.getStatus().getMessage()); } if (logger.isDebugEnabled()) logger.debug("RemoteStore.hasDocument() " + documentPath + " = " + hasDocument); return hasDocument; }
public boolean hasDocument(String documentPath) throws IOException { boolean hasDocument = false; Response res = callGet(buildEncodeCall(API_HAS, documentPath)); if (Status.STATUS_OK == res.getStatus().getCode()) { hasDocument = Boolean.parseBoolean(res.getResponse()); } else { throw new IOException("Unable to test document path: " + documentPath + " in remote store: " + this.getEndpoint() + " due to error: " + res.getStatus().getCode() + " " + res.getStatus().getMessage()); } if (logger.isDebugEnabled()) logger.debug("RemoteStore.hasDocument() " + documentPath + " = " + hasDocument); return hasDocument; }
public boolean hasDocument(String documentPath) throws IOException { boolean hasDocument = false; Response res = callGet(buildEncodeCall(API_HAS, documentPath)); if (Status.STATUS_OK == res.getStatus().getCode()) { hasDocument = Boolean.parseBoolean(res.getResponse()); } else { throw new IOException("Unable to test document path: " + documentPath + " in remote store: " + this.getEndpoint() + " due to error: " + res.getStatus().getCode() + " " + res.getStatus().getMessage()); } if (logger.isDebugEnabled()) logger.debug("RemoteStore.hasDocument() " + documentPath + " = " + hasDocument); return hasDocument; }
private Response getDocumentResponse(String path) throws IOException { Response res = callGet(buildEncodeCall(API_GET, path)); if (logger.isDebugEnabled()) logger.debug("RemoteStore.getDocument() " + path + " = " + res.getStatus().getCode()); if (Status.STATUS_OK == res.getStatus().getCode()) { return res; } else { throw new IOException("Unable to retrieve document path: " + path + " in remote store: " + this.getEndpoint() + " due to error: " + res.getStatus().getCode() + " " + res.getStatus().getMessage()); } }
private Response getDocumentResponse(String path) throws IOException { Response res = callGet(buildEncodeCall(API_GET, path)); if (logger.isDebugEnabled()) logger.debug("RemoteStore.getDocument() " + path + " = " + res.getStatus().getCode()); if (Status.STATUS_OK == res.getStatus().getCode()) { return res; } else { throw new IOException("Unable to retrieve document path: " + path + " in remote store: " + this.getEndpoint() + " due to error: " + res.getStatus().getCode() + " " + res.getStatus().getMessage()); } }
private Response getDocumentResponse(String path) throws IOException { Response res = callGet(buildEncodeCall(API_GET, path)); if (logger.isDebugEnabled()) logger.debug("RemoteStore.getDocument() " + path + " = " + res.getStatus().getCode()); if (Status.STATUS_OK == res.getStatus().getCode()) { return res; } else { throw new IOException("Unable to retrieve document path: " + path + " in remote store: " + this.getEndpoint() + " due to error: " + res.getStatus().getCode() + " " + res.getStatus().getMessage()); } }