Package org.akubraproject

Examples of org.akubraproject.UnsupportedIdException


  }

  public Blob moveTo(URI blobId, Map<String, String> hints)
      throws IOException {
    if (isWildcard) {
      throw new UnsupportedIdException(blobId,
          "WildcastFSBlob cannot be moved.");
    }

    ensureOpen();
View Full Code Here


  static URI validateId(URI blobId) throws UnsupportedIdException {
    if (blobId == null)
      throw new NullPointerException("Id cannot be null");
    if (!blobId.getScheme().equalsIgnoreCase(scheme))
      throw new UnsupportedIdException(blobId, "Id must be in " + scheme
          + " scheme");
    String path = blobId.getRawSchemeSpecificPart();
    if (path.startsWith("/"))
      throw new UnsupportedIdException(blobId,
          "Id must specify a relative path");
    try {
      // insert a '/' so java.net.URI normalization works
      URI tmp = new URI(scheme + ":/" + path);
      String nPath = tmp.normalize().getRawSchemeSpecificPart()
          .substring(1);
      if (nPath.equals("..") || nPath.startsWith("../"))
        throw new UnsupportedIdException(blobId,
            "Id cannot be outside top-level directory");
      return new URI(scheme + ":" + nPath);
    } catch (URISyntaxException wontHappen) {
      throw new Error(wontHappen);
    }
View Full Code Here

      guid = matcher.group(3);
      serialNumber = matcher.group(4);
      dsid = matcher.group(5);
    } else {
      try {
        throw new UnsupportedIdException(uri);
      } catch (UnsupportedIdException e) {
        e.printStackTrace();
      }
    }
  }
View Full Code Here

        } catch (UnsupportedIdException e) {
          // skip this one
        }
      }

      throw new UnsupportedIdException(blobId);
    }
View Full Code Here

  }

  @Override
  protected void validateId(URI blobId) throws UnsupportedIdException {
    if (blobId.toString().length() > 1000)
      throw new UnsupportedIdException(blobId, "Blob id must be less than 1000 characters long");
  }
View Full Code Here

  static URI validateId(URI blobId) throws UnsupportedIdException {
    if (blobId == null)
      throw new NullPointerException("Id cannot be null");
    if (!blobId.getScheme().equalsIgnoreCase(scheme))
      throw new UnsupportedIdException(blobId, "Id must be in " + scheme + " scheme");
    String path = blobId.getRawSchemeSpecificPart();
    if (path.startsWith("/"))
      throw new UnsupportedIdException(blobId, "Id must specify a relative path");
    try {
      // insert a '/' so java.net.URI normalization works
      URI tmp = new URI(scheme + ":/" + path);
      String nPath = tmp.normalize().getRawSchemeSpecificPart().substring(1);
      if (nPath.equals("..") || nPath.startsWith("../"))
        throw new UnsupportedIdException(blobId, "Id cannot be outside top-level directory");
      if (nPath.endsWith("/"))
        throw new UnsupportedIdException(blobId, "Id cannot specify a directory");
      return new URI(scheme + ":" + nPath);
    } catch (URISyntaxException wontHappen) {
      throw new Error(wontHappen);
    }
  }
View Full Code Here

TOP

Related Classes of org.akubraproject.UnsupportedIdException

Copyright © 2018 www.massapicom. 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.