Changeset 24915
- Timestamp:
- 2012-01-06T16:07:14+13:00 (12 years ago)
- Location:
- main/trunk/gli/src/org/greenstone/gatherer
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/gli/src/org/greenstone/gatherer/feedback/Base64.java
r12051 r24915 378 378 return encodeBytes( source, 0, source.length, NO_OPTIONS ); 379 379 } // end encodeBytes 380 381 382 380 381 /** 382 * Added this variant of the method in so that RemoteGreenstoneServer.java 383 * can process large source and target filenames, without Base64 encoding 384 * them introducing a new line. 385 * @param source The data to convert 386 * @since January 387 */ 388 public static String encodeBytesInSingleLine( byte[] source) 389 { 390 return encodeBytes( source, 0, source.length, DONT_BREAK_LINES); 391 } // end encodeBytes 392 383 393 /** 384 394 * Encodes a byte array into Base64 notation. -
main/trunk/gli/src/org/greenstone/gatherer/remote/RemoteGreenstoneServerAction.java
r22470 r24915 151 151 String delete_collection_file_command = "cmd=delete-collection-file"; 152 152 delete_collection_file_command += "&c=" + URLEncoder.encode(collection_name.replace(File.separatorChar, '|'), "UTF-8"); 153 delete_collection_file_command += "&file=" + Base64.encodeBytes (collection_file_relative_path.getBytes());153 delete_collection_file_command += "&file=" + Base64.encodeBytesInSingleLine(collection_file_relative_path.getBytes()); 154 154 action_output = remote.sendCommandToServer(delete_collection_file_command, null); 155 155 } … … 312 312 file_exists_command += "&c=" + URLEncoder.encode(collection_name.replace(File.separatorChar, '|'), "UTF-8"); 313 313 // base64 encode the filename to preserve special characters 314 file_exists_command += "&file=" + Base64.encodeBytes (collection_file_relative_path.getBytes());314 file_exists_command += "&file=" + Base64.encodeBytesInSingleLine(collection_file_relative_path.getBytes()); 315 315 316 316 // returns either "File <filename> exists" or "File <filename> does not exist" … … 476 476 String move_collection_file_command = "cmd=move-collection-file"; 477 477 move_collection_file_command += "&c=" + URLEncoder.encode(collection_name.replace(File.separatorChar, '|'), "UTF-8"); 478 move_collection_file_command += "&source=" + Base64.encodeBytes (source_collection_file_relative_path.getBytes());479 move_collection_file_command += "&target=" + Base64.encodeBytes (target_collection_file_relative_path.getBytes());478 move_collection_file_command += "&source=" + Base64.encodeBytesInSingleLine(source_collection_file_relative_path.getBytes()); 479 move_collection_file_command += "&target=" + Base64.encodeBytesInSingleLine(target_collection_file_relative_path.getBytes()); 480 480 //move_collection_file_command += "&source=" + URLEncoder.encode(source_collection_file_relative_path, "UTF-8"); 481 481 //move_collection_file_command += "&target=" + URLEncoder.encode(target_collection_file_relative_path, "UTF-8");
Note:
See TracChangeset
for help on using the changeset viewer.