Changeset 18645

Show
Ignore:
Timestamp:
09.03.2009 19:22:54 (10 years ago)
Author:
ak19
Message:

Base64 encoding the filename that is to be src_replaced or exploded in order to preserve any special characters in the filename when transferring the filename data to the remote greenstone server.

Location:
gli/trunk/src/org/greenstone/gatherer/gui
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • gli/trunk/src/org/greenstone/gatherer/gui/ExplodeMetadataDatabasePrompt.java

    r18376 r18645  
    4747import org.greenstone.gatherer.collection.ScriptOptions; 
    4848import org.greenstone.gatherer.collection.Collection; 
     49import org.greenstone.gatherer.feedback.Base64; 
    4950import org.greenstone.gatherer.greenstone.LocalGreenstone; 
    5051import org.greenstone.gatherer.gui.tree.DragTree; 
     
    282283                                                          metadata_file, collection_directory_path); 
    283284        command_parts_list.add("-file"); 
    284         command_parts_list.add(metadata_file_relative_path); 
     285        command_parts_list.add(Base64.encodeBytes(metadata_file_relative_path.getBytes())); 
    285286 
    286287        // When running remotely we also need the collection name as the last argument 
  • gli/trunk/src/org/greenstone/gatherer/gui/ReplaceSrcDocWithHtmlPrompt.java

    r18412 r18645  
    4949import org.greenstone.gatherer.collection.ScriptOptions; 
    5050import org.greenstone.gatherer.collection.Collection; 
     51import org.greenstone.gatherer.feedback.Base64; 
    5152import org.greenstone.gatherer.greenstone.LocalGreenstone; 
    5253import org.greenstone.gatherer.gui.tree.DragTree; 
     
    283284        String srcdoc_file_relative_path = Gatherer.remoteGreenstoneServer.getPathRelativeToDirectory( 
    284285        this.srcdoc_files[fileNum], collection_directory_path); // preserves spaces in filename 
     286 
     287        // base64 encode the relative filepath, so that special characters in the filename are preserved 
    285288        command_parts_list.add("-file"); 
    286         command_parts_list.add(srcdoc_file_relative_path); 
     289        command_parts_list.add(Base64.encodeBytes(srcdoc_file_relative_path.getBytes())); 
    287290                 
    288291        // When running remotely we also need the collection name as the last argument 
     
    396399            // download any assoc folder which is srcfilename+"_files" 
    397400            File assoc_folder = new File(srcdoc_files[i].getParentFile(), suffixlessFilename+"_files"); 
     401             
    398402            // If an associated_folder by such a name exists, download it 
    399403            if(Gatherer.remoteGreenstoneServer.exists(CollectionManager.getLoadedCollectionName(), assoc_folder)) {