Search in sources :

Example 71 with LogicalData

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

the class Assimilator method addFile.

private void addFile(Connection connection, VFile f, Long parentRef, long ssID) throws SQLException, VlException, NoSuchAlgorithmException {
    long pdriGroupID = addPdrigroupTable(connection);
    LogicalData entry = new LogicalData();
    entry.setContentTypesAsString(f.getMimeType());
    entry.setCreateDate(f.getModificationTime());
    entry.setLength(f.getLength());
    entry.setModifiedDate(f.getModificationTime());
    entry.setName(f.getName());
    entry.setOwner("admin");
    entry.setParentRef(parentRef);
    entry.setType(Constants.LOGICAL_FILE);
    entry.setPdriGroupId(pdriGroupID);
    // if(f instanceof VChecksum){
    // String chs = ((VChecksum) f).getChecksum(VChecksum.MD5);
    // entry.setChecksum();
    // }
    long pdriID = addPDRI(connection, f.getName(), ssID, pdriGroupID, false, DesEncrypter.generateKey());
    addLogicalData(connection, entry);
}
Also used : LogicalData(nl.uva.cs.lobcder.resources.LogicalData)

Aggregations

LogicalData (nl.uva.cs.lobcder.resources.LogicalData)71 Connection (java.sql.Connection)29 SQLException (java.sql.SQLException)29 Permissions (nl.uva.cs.lobcder.auth.Permissions)29 MyPrincipal (nl.uva.cs.lobcder.auth.MyPrincipal)20 PreparedStatement (java.sql.PreparedStatement)11 ResultSet (java.sql.ResultSet)10 Path (io.milton.common.Path)7 ArrayList (java.util.ArrayList)7 BadRequestException (io.milton.http.exceptions.BadRequestException)6 NotAuthorizedException (io.milton.http.exceptions.NotAuthorizedException)5 PDRIDescr (nl.uva.cs.lobcder.resources.PDRIDescr)5 ConflictException (io.milton.http.exceptions.ConflictException)4 URISyntaxException (java.net.URISyntaxException)4 Stack (java.util.Stack)4 Path (javax.ws.rs.Path)4 LogicalDataWrapped (nl.uva.cs.lobcder.rest.wrappers.LogicalDataWrapped)4 VRL (nl.uva.vlet.vrl.VRL)4 PreConditionFailedException (io.milton.http.exceptions.PreConditionFailedException)3 NoSuchAlgorithmException (java.security.NoSuchAlgorithmException)3