Changeset 16671 for gli


Ignore:
Timestamp:
08/07/08 13:49:22 (12 years ago)
Author:
ak19
Message:

Instead of Base64 decoding the gsdl_source_filename it now URL decodes. This works with the doc.pm perl script which URLencodes gsdl_source_filename rather than applying base64 encoding on it (which is done to preserve the original character encoding).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gli/trunk/src/org/greenstone/gatherer/metadata/DocXMLFile.java

    r16579 r16671  
    3030import java.io.*;
    3131import java.util.*;
     32import java.net.URLDecoder;
    3233import org.greenstone.gatherer.DebugStream;
    3334import org.greenstone.gatherer.util.Utility;
    34 import org.greenstone.gatherer.feedback.Base64;
     35
    3536
    3637/** This class represents one doc.xml file */
     
    230231            gsdlsourcefilename_value = gsdlsourcefilename_value.substring(1);
    231232
    232             // Apply Base64 decoding - note that encoding into base64 may have
    233             // encoded some characters as slashes. Since slash characters are
    234             // removed below the decoding must be done before that to ensure
    235             // only genuine slashes remain for processing:
    236             gsdlsourcefilename_value = new String(Base64.decode(gsdlsourcefilename_value));
    237             //System.err.println("****decodedSrcFilename is: " + gsdlsourcefilename_value);
     233            // URL decode gsdlsourcefilename. Need to set the decoder to use the default system encoding
     234            // This is stored in the System's file.encoding property.
     235            gsdlsourcefilename_value = URLDecoder.decode(gsdlsourcefilename_value, System.getProperty("file.encoding"));
    238236
    239237            // Make sure the path matches the OS that is running
Note: See TracChangeset for help on using the changeset viewer.