Search in sources :

Example 21 with PDRIDescr

use of nl.uva.cs.lobcder.resources.PDRIDescr in project lobcder by skoulouzis.

the class Catalogue method createPdriDescr.

private PDRIDescr createPdriDescr(File key) throws IOException {
    PDRIDescr pDRIDescr = new PDRIDescr();
    pDRIDescr.setCashe(true);
    pDRIDescr.setEncrypt(false);
    // file:/home/alogo/servers/apache-tomcat-6.0.36/temp/uploads/LOBCDER-REPLICA-vTEST
    String localDir = key.getParentFile().toURI().toString().replaceAll(Util.getWorkingFolderName() + "/", "");
    pDRIDescr.setResourceUrl(localDir);
    pDRIDescr.setName(key.getName());
    pDRIDescr.setPassword("fake");
    pDRIDescr.setUsername("fake");
    return pDRIDescr;
}
Also used : PDRIDescr(nl.uva.cs.lobcder.resources.PDRIDescr)

Example 22 with PDRIDescr

use of nl.uva.cs.lobcder.resources.PDRIDescr in project lobcder by skoulouzis.

the class Catalogue method isCacheInPdriList.

private boolean isCacheInPdriList(File cacheFile, LogicalDataWrapped logicalData) {
    String resourceURI = "file:///" + cacheFile.getAbsoluteFile().getParentFile().getParent();
    List<PDRIDescr> pdris = logicalData.getPdriList();
    if (pdris != null) {
        for (PDRIDescr p : pdris) {
            if (p.getResourceUrl().equals(resourceURI)) {
                return true;
            }
        }
    }
    return false;
}
Also used : PDRIDescr(nl.uva.cs.lobcder.resources.PDRIDescr)

Aggregations

PDRIDescr (nl.uva.cs.lobcder.resources.PDRIDescr)22 IOException (java.io.IOException)8 PDRI (nl.uva.cs.lobcder.resources.PDRI)7 SQLException (java.sql.SQLException)6 Permissions (nl.uva.cs.lobcder.auth.Permissions)5 LogicalData (nl.uva.cs.lobcder.resources.LogicalData)5 URI (java.net.URI)4 URISyntaxException (java.net.URISyntaxException)4 UnknownHostException (java.net.UnknownHostException)4 ArrayList (java.util.ArrayList)4 LogicalDataWrapped (nl.uva.cs.lobcder.rest.wrappers.LogicalDataWrapped)4 BadRequestException (io.milton.http.exceptions.BadRequestException)3 NotFoundException (io.milton.http.exceptions.NotFoundException)3 InputStream (java.io.InputStream)3 Path (javax.ws.rs.Path)3 MyPrincipal (nl.uva.cs.lobcder.auth.MyPrincipal)3 ConflictException (io.milton.http.exceptions.ConflictException)2 NotAuthorizedException (io.milton.http.exceptions.NotAuthorizedException)2 UnsupportedEncodingException (java.io.UnsupportedEncodingException)2 SocketException (java.net.SocketException)2