Examples of PDURI


Examples of eu.planets_project.ifr.core.storage.impl.util.PDURI

     */
  @javax.jws.WebMethod()
  public URI[] list(URI pdURI) throws SOAPException {
        log.fine("DataManager::list(URI pdURI)");
    URI[] _retVal = null;
    PDURI _pdURI = null;
    String _path = null;
   
    try {
      log.fine("Testing for null URI");
      if (pdURI == null)
      {
        log.fine("URI is empty so return root");
        _retVal = new URI[1];
        log.fine("Assigning array item");
        _retVal[0] = PDURI.formDataRegistryRootURI(properties.getProperty("planets.server.hostname"), properties.getProperty("planets.server.port"), properties.getProperty("planets.if.dr.default.name"));
        return _retVal;
      }
      log.fine("URI is NOT NULL");
      _pdURI = new PDURI(pdURI);
      log.fine("parsing the Data Registry path");
      _path = _pdURI.getDataRegistryPath();
      log.fine("Data Registry path is:" + _path);
    } catch (URISyntaxException _exp) {
      log.fine(_exp.getMessage());
      throw new SOAPException(_exp);
    }

    try {
      ArrayList<String> _pathList = jcrManager.list(_path);
      if (_pathList != null) {
        _retVal = new URI[_pathList.size()];
        int _arrayCount = 0;
        log.fine("Cycling through returned paths, there are " + _pathList.size() + " elements");
        for (String _string : _pathList) {
          log.fine("Getting a new URI for:" + _string);
          _pdURI.replaceDecodedPath(_string);
          _retVal[_arrayCount++] = _pdURI.getURI();
          log.fine("New URI added:" + _retVal[_arrayCount - 1]);
        }
      }
    } catch (URISyntaxException _exp) {
      log.fine(_exp.getMessage());
View Full Code Here

Examples of eu.planets_project.ifr.core.storage.impl.util.PDURI

     */
  @javax.jws.WebMethod()
  public URI listDownladURI(URI pdURI) throws SOAPException {
      log.fine("DataManager::listDownloadURI(URI pdURI)");
      URI _retVal = null;
      PDURI _parsedURI = null;
      try {
          _parsedURI = new PDURI(pdURI);
        // Check that the item exists, if not throw a SOAP Exception
        if (!this.jcrManager.nodeExists(_parsedURI.getDataRegistryPath())) {
          String _message = "DataManager.listDownloadURI() Cannot locate item " + pdURI.toASCIIString();
          log.fine(_message);;
          throw new SOAPException(_message);
        }
      } catch (URISyntaxException _exp) {
      String _message = "DataManager.listDownloadURI() " + pdURI.toASCIIString() + " is not a PLANETS Data Registry URI.";
      log.fine(_message+": "+_exp.getMessage());
      throw new SOAPException(_message, _exp);
      } catch (RepositoryException _exp) {
      String _message = "DataManager.listDownloadURI() Repository call failed.";
      log.fine(_message+": "+_exp.getMessage());
      throw new SOAPException(_message, _exp);
      }
  // Now get the JBOSS Server and port
    String _serverName = properties.getProperty("planets.server.hostname");
  String _port = properties.getProperty("planets.server.port");
  String _webdavRoot = properties.getProperty("jcr.local.webdav.root");


      try {
          // Return a download WEB_DAV URL
        _retVal = new URI("http://" + _serverName + ":" + _port + _webdavRoot + _parsedURI.getDataRegistryPath());
      } catch (URISyntaxException _exp) {
      String _message = "DataManager.listDownloadURI() Cannot get server URI.";
      log.fine(_message+": "+_exp.getMessage());;
      throw new SOAPException(_message, _exp);
      }
View Full Code Here

Examples of eu.planets_project.ifr.core.storage.impl.util.PDURI

     */
  @Deprecated
  public InputStream retrieve(URI pdURI) throws PathNotFoundException, URISyntaxException {
    log.fine("DataManager::openFileStream(URI pdURI)");
    InputStream _stream = null;
    PDURI _parsedURI = new PDURI(pdURI);
    try {
      _stream = jcrManager.readContent(_parsedURI.getDataRegistryPath());
    } catch (LoginException _exp) {
      throw new RuntimeException(_exp);
    } catch (PathNotFoundException _exp) {
      log.fine("DataManager::openFileStream() Couldn't find path");
      throw _exp;
View Full Code Here

Examples of eu.planets_project.ifr.core.storage.impl.util.PDURI

     */
  @Deprecated
  public void store(URI pdURI, InputStream stream) throws LoginException, RepositoryException, URISyntaxException {
    log.fine("DataManager::writeFileStream(URI pdURI, FileInputStream stream)");
    try {
      PDURI _parsedURI = new PDURI(pdURI);
      jcrManager.addBinaryContent(_parsedURI.getDataRegistryPath(), stream);
    } catch (LoginException _exp) {
      log.fine("DataManager::writeFileStream() Couldn't log user into jcr");
      throw _exp;
    } catch (RepositoryException _exp) {
      log.fine("DataManager::writeFileStream() Repository Exception adding content");
View Full Code Here

Examples of eu.planets_project.ifr.core.storage.impl.util.PDURI

  @javax.jws.WebMethod()
  @Deprecated
  public String read(URI pdURI) throws SOAPException {
    log.fine("DataManager::read(URI pdURI)");
    try{
      PDURI _parsedURI = new PDURI(pdURI);
      FileHandler _encoder = new FileHandler(jcrManager.readContent(_parsedURI.getDataRegistryPath()));
      log.fine("DataManager::read() getting XML document");
      return _encoder.getXmlDocument();
    } catch (ParserConfigurationException _exp) {
      String _message = "DataManager.read() Encoding exception for UTF8??";
      log.fine(_message+": "+_exp.getMessage());
View Full Code Here

Examples of eu.planets_project.ifr.core.storage.impl.util.PDURI

     * @see eu.planets_project.ifr.core.storage.api.DataManagerRemote#store(java.net.URI, java.lang.String)
     */
  @Deprecated
  public void store(URI pdURI, String encodedFile) throws SOAPException {
    try {
      PDURI _parsedURI = new PDURI(pdURI);
      FileHandler _handler = new FileHandler(encodedFile);
      ByteArrayInputStream _byteStream = new ByteArrayInputStream(_handler.getDecodedBytes());
      jcrManager.addBinaryContent(_parsedURI.getDataRegistryPath(), _byteStream);
    } catch (LoginException _exp) {
      String _message = "DataManager.store() Repository login error.";
      log.fine(_message+": "+_exp.getMessage());
      throw new SOAPException(_message, _exp);
    } catch (RepositoryException _exp) {
View Full Code Here

Examples of eu.planets_project.ifr.core.storage.impl.util.PDURI

  @javax.jws.WebMethod()
  public byte[] retrieveBinary(URI pdURI) throws SOAPException
  {
    byte[] _binary = null;
    try {
      PDURI _parsedURI = new PDURI(pdURI);
      InputStream _inStream = this.jcrManager.readContent(_parsedURI.getDataRegistryPath());
      ByteArrayOutputStream _outStream = new ByteArrayOutputStream(1024);
      byte[] _bytes = new byte[512];
      int _readBytes;
      while ((_readBytes = _inStream.read(_bytes)) > 0) {
        _outStream.write(_bytes, 0, _readBytes);
View Full Code Here

Examples of eu.planets_project.ifr.core.storage.impl.util.PDURI

  public void storeBinary(URI pdURI, byte[] binary) throws LoginException, RepositoryException, URISyntaxException {
    log.fine("DataManager:storeBinary(URI pdURI, byte[] binary)");
    ByteArrayInputStream _inStream = new ByteArrayInputStream(binary);
   
    try {
      PDURI _parsedURI = new PDURI(pdURI);
      jcrManager.addBinaryContent(_parsedURI.getDataRegistryPath(), _inStream);
    } catch (LoginException _exp) {
      log.fine("DataManager::writeFileStream() Couldn't log user into jcr");
      throw _exp;
    } catch (RepositoryException _exp) {
      log.fine("DataManager::writeFileStream() Repository Exception adding content");
View Full Code Here

Examples of eu.planets_project.ifr.core.storage.impl.util.PDURI

     */
  @javax.jws.WebMethod()
  public URI[] findFilesWithNameContaining(URI pdURI, String name) throws SOAPException {
    URI[] _retVal = null;
    try {
      PDURI _parsedURI = new PDURI(pdURI);
      ArrayList<String> _pathList = this.jcrManager.findFilesWithNameContaining(_parsedURI.getDataRegistryPath(), name);
      if (_pathList != null) {
        _retVal = new URI[_pathList.size()];
        int _arrayCount = 0;
        log.fine("Cycling through returned paths, there are " + _pathList.size() + " elements");
        for (String _string : _pathList) {
          _parsedURI.replaceDecodedPath(_string);
          _retVal[_arrayCount++] = _parsedURI.getURI();
        }
      }
    } catch (Exception _exp) {
      throw new SOAPException(_exp);
    }
View Full Code Here

Examples of eu.planets_project.ifr.core.storage.impl.util.PDURI

     */
  @javax.jws.WebMethod()
  public URI[] findFilesWithExtension(URI pdURI, String ext) throws SOAPException {
    URI[] _retVal = null;
    try {
      PDURI _parsedURI = new PDURI(pdURI);
      ArrayList<String> _pathList = this.jcrManager.findFilesWithExtension(_parsedURI.getDataRegistryPath(), ext);
      if (_pathList != null) {
        _retVal = new URI[_pathList.size()];
        int _arrayCount = 0;
        log.fine("Cycling through returned paths, there are " + _pathList.size() + " elements");
        for (String _string : _pathList) {
          _parsedURI.replaceDecodedPath(_string);
          _retVal[_arrayCount++] = _parsedURI.getURI();
        }
      }
    } catch (Exception _exp) {
      throw new SOAPException(_exp);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.