Changeset 10561


Ignore:
Timestamp:
2005-08-25T12:40:29+12:00 (19 years ago)
Author:
mdewsnip
Message:

Now calls the appropriate RemoteGreenstoneServer function itself.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gli/src/org/greenstone/gatherer/file/FileManager.java

    r10557 r10561  
    170170        file_queue.addJob(id, source, source_nodes, target, target_node, type, true);
    171171        if (Gatherer.isGsdlRemote) {
    172             RemoteGreenstoneServer.addJob(id, source_nodes, target_node, type);
     172            String collection_name = Gatherer.c_man.getCollection().getName();
     173
     174            // Perform the appropriate action based on the job type (RemoteGreenstoneServer will queue)
     175            if (type == FileJob.COPY) {
     176            File[] source_files = new File[source_nodes.length];
     177            for (int i = 0; i < source_nodes.length; i++) {
     178                source_files[i] = source_nodes[i].getFile();
     179            }
     180            RemoteGreenstoneServer.uploadFilesIntoCollection(collection_name, source_files, target_node.getFile());
     181            }
     182            else if (type == FileJob.DELETE) {
     183            RemoteGreenstoneServer.deleteCollectionFile(collection_name, source_nodes[0].getFile());
     184            }
     185            else if (type == FileJob.MOVE) {
     186            RemoteGreenstoneServer.moveCollectionFile(collection_name, source_nodes[0].getFile(), target_node.getFile());
     187            }
    173188        }
    174189        }
     
    254269            if (Gatherer.isGsdlRemote) {
    255270                long id = System.currentTimeMillis();
    256                 CollectionTreeNode new_folder_node = new CollectionTreeNode(folder_file);
    257                 RemoteGreenstoneServer.addJob(id, new FileNode[] { new_folder_node }, null, FileJob.NEW_FOLDER);
     271                RemoteGreenstoneServer.newCollectionDirectory(Gatherer.c_man.getCollection().getName(), folder_file);
    258272            }
    259273            }
Note: See TracChangeset for help on using the changeset viewer.