Package com.bhle.access.util

Examples of com.bhle.access.util.FedoraURI


    }

  }

  private static void setPageOcr(String pageUri, PageInfo page) {
    FedoraURI fedoraUri = new FedoraURI(URI.create(pageUri + "/OCR"));
    URI staticUri = StaticURI.toStaticHttpUri(fedoraUri);
    page.setOcrUrl(staticUri.toString());
  }
View Full Code Here


    page.setHeight(dimensions[0]);
    page.setWidth(dimensions[1]);
  }

  private static File getPageFilePath(String pageUri) {
    FedoraURI fedoraUri = new FedoraURI(URI.create(pageUri + "/JP2"));
    File file = new File(StaticURI.toStaticFileUri(fedoraUri));
    return file;
  }
View Full Code Here

    File file = new File(StaticURI.toStaticFileUri(fedoraUri));
    return file;
  }

  private static URI getPageHttpPath(String pageUri) {
    FedoraURI fedoraUri = new FedoraURI(URI.create(pageUri + "/JP2"));
    return StaticURI.toStaticHttpUri(fedoraUri);
  }
View Full Code Here

    FedoraURI fedoraUri = new FedoraURI(URI.create(pageUri + "/JP2"));
    return StaticURI.toStaticHttpUri(fedoraUri);
  }

  private static Olef getOlef(String guid) throws IOException {
    FedoraURI olefUri = FedoraURI.getFedoraUri(guid, "OLEF");
    URI olefHttpUri = StaticURI.toStaticFileUri(olefUri);
    return new Olef(olefHttpUri.toURL());
  }
View Full Code Here

    String entryPage = olef.getEntryPage();
    if (entryPage.equals("")) {
      entryPage = "1";
    }
    int entryPageSequence = Integer.valueOf(entryPage);
    FedoraURI entryPageUri = FedoraURI.getFedoraUri(guid,
        entryPageSequence, "JP2");
    URI entryPageHttpUri = StaticURI.toStaticFileUri(entryPageUri);
    InputStream jp2InputStream = null;
    jp2InputStream = entryPageHttpUri.toURL().openStream();
    return ImageUtil.jp2ToThumbnail(jp2InputStream);
View Full Code Here

    return ImageUtil.jp2ToThumbnail(jp2InputStream);
  }

  private static Olef getOlef(String guid) {
    try {
      FedoraURI olefUri = FedoraURI.getFedoraUri(guid, "OLEF");
      URI olefHttpUri = StaticURI.toStaticHttpUri(olefUri);
      return new Olef(olefHttpUri.toURL());
    } catch (IOException e) {
      e.printStackTrace();
    }
View Full Code Here

    }

    List<StringWithBox> result = new ArrayList<StringWithBox>();

    for (URI dsUri : dsUris) {
      FedoraURI pageFedoraUri = new FedoraURI(dsUri);
      URI pageHttpUri = StaticURI.toStaticFileUri(pageFedoraUri);
      String text = "";
      try {
        text = IOUtils.toString(pageHttpUri.toURL().openStream());
      } catch (MalformedURLException e) {
        e.printStackTrace();
      } catch (IOException e) {
        e.printStackTrace();
      }

      int sequence = Integer.valueOf(pageFedoraUri.getSerialNumber());
      result.add(new StringWithBox(sequence - 1, text));
    }
    return result;
  }
View Full Code Here

      for (String pid : pids) {
        Date lastModifiedDate = FedoraUtil.getLastModifiedDate(pid
            .split("/")[1]);
        if (lastModifiedDate.after(from)
            && lastModifiedDate.before(until)) {
          FedoraURI fedoraURI = new FedoraURI(URI.create(pid + "/"
              + metadataFormat.getDatastream()));
          result.add(buildRecord(fedoraURI, metadataFormat, setInfo,
              lastModifiedDate));
        }
      }
View Full Code Here

  public PairtreePathMapper(int fixedPathLength) {
    this.fixedPathLength = fixedPathLength;
  }

  public String getInternalPath(URI externalId) {
    FedoraURI fedoraURI = new FedoraURI(externalId);
    StringBuffer fullPath = new StringBuffer();

    String guid = fedoraURI.getGuid();

    int pathLengthCount = 0;
    for (int i = 0; i < guid.length(); i++) {
      fullPath.append(guid.charAt(i));
      pathLengthCount++;
View Full Code Here

  private static final Logger logger = LoggerFactory
      .getLogger(SubFolderFileMapper.class);

  public String getInternalFile(URI externalId) {
    FedoraURI fedoraURI = new FedoraURI(externalId);
    String guid = fedoraURI.getGuid();
    String serialNumber = fedoraURI.getSerialNumber();
    String dsid = fedoraURI.getDsid();

    StringBuffer fileName = new StringBuffer();

    if (serialNumber != null && !serialNumber.equals("")) {
      if (dsid != null && !dsid.equals("")) {
        fileName.append(dsid.toLowerCase() + "/");
      } else {
        fileName.append("*/");
      }
    }

    fileName.append(guid);

    if (serialNumber != null && !serialNumber.equals("")) {
      fileName.append("_" + serialNumber);
    } else if (dsid != null && !dsid.equals("")) {
      fileName.append("_" + dsid.toLowerCase());
    } else {
      fileName.append("_*");
    }

    String suffix = ConverterManager.getSuffix(fedoraURI.getDsid());
    if (suffix != null) {
      fileName.append("." + suffix);
    } else {
      fileName.append(".*");
    }
 
View Full Code Here

TOP

Related Classes of com.bhle.access.util.FedoraURI

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.