Search in sources :

Example 11 with VRL

use of nl.uva.vlet.vrl.VRL in project lobcder by skoulouzis.

the class Assimilator method add.

public void add(VComposite dir, String base, Connection connection, long ssid, boolean addFiles) throws MalformedURLException, VlException, SQLException, NoSuchAlgorithmException {
    VNode[] nodes = dir.getNodes();
    for (VNode f : nodes) {
        VRL currentPath = new VRL(f.getPath().replaceFirst(base, ""));
        LogicalData register = getLogicalDataByPath(Path.path(currentPath.getPath()), connection);
        LogicalData parent = getLogicalDataByPath(Path.path(currentPath.getPath()).getParent(), connection);
        Long parentRef = new Long(1);
        if (parent == null) {
            parentRef = new Long(1);
        } else {
            parentRef = parent.getUid();
        }
        if (f.isComposite()) {
            if (register == null) {
                LogicalData entry = new LogicalData();
                if (f instanceof VDir) {
                    VDir d = (VDir) f;
                    entry.setCreateDate(d.getModificationTime());
                    entry.setModifiedDate(d.getModificationTime());
                } else {
                    entry.setCreateDate(System.currentTimeMillis());
                    entry.setModifiedDate(System.currentTimeMillis());
                }
                entry.setName(f.getName());
                entry.setOwner(importingOwner);
                entry.setParentRef(parentRef);
                register = registerDirLogicalData(entry, connection);
            }
            add((VComposite) f, base, connection, ssid, addFiles);
        } else if (addFiles) {
            if (register == null) {
                System.err.println(f.getVRL());
                addFile(connection, (VFile) f, parentRef, ssid);
            }
        }
    }
}
Also used : VRL(nl.uva.vlet.vrl.VRL) LogicalData(nl.uva.cs.lobcder.resources.LogicalData) VNode(nl.uva.vlet.vrs.VNode) VDir(nl.uva.vlet.vfs.VDir) VFile(nl.uva.vlet.vfs.VFile)

Aggregations

VRL (nl.uva.vlet.vrl.VRL)11 LogicalData (nl.uva.cs.lobcder.resources.LogicalData)4 VlException (nl.uva.vlet.exception.VlException)4 VFSClient (nl.uva.vlet.vfs.VFSClient)4 GridProxy (nl.uva.vlet.util.cog.GridProxy)3 VFile (nl.uva.vlet.vfs.VFile)3 ServerInfo (nl.uva.vlet.vrs.ServerInfo)3 VRSContext (nl.uva.vlet.vrs.VRSContext)3 URI (java.net.URI)2 URISyntaxException (java.net.URISyntaxException)2 InvalidAlgorithmParameterException (java.security.InvalidAlgorithmParameterException)2 InvalidKeyException (java.security.InvalidKeyException)2 NoSuchAlgorithmException (java.security.NoSuchAlgorithmException)2 NoSuchPaddingException (javax.crypto.NoSuchPaddingException)2 JAXBException (javax.xml.bind.JAXBException)2 VRLSyntaxException (nl.uva.vlet.exception.VRLSyntaxException)2 VNode (nl.uva.vlet.vrs.VNode)2 java.io (java.io)1 UnknownHostException (java.net.UnknownHostException)1 CertificateException (java.security.cert.CertificateException)1