Revision 5760
Added by ben leinfelder over 13 years ago
ResourceHandler.java | ||
---|---|---|
62 | 62 |
import edu.ucsb.nceas.metacat.DBUtil; |
63 | 63 |
import edu.ucsb.nceas.metacat.IdentifierManager; |
64 | 64 |
import edu.ucsb.nceas.metacat.McdbDocNotFoundException; |
65 |
import edu.ucsb.nceas.metacat.MetaCatServlet; |
|
65 | 66 |
import edu.ucsb.nceas.metacat.MetacatHandler; |
66 | 67 |
import edu.ucsb.nceas.metacat.client.InsufficientKarmaException; |
67 | 68 |
import edu.ucsb.nceas.metacat.dataone.CrudService; |
... | ... | |
1227 | 1228 |
private InputStream stringToStream(String s) |
1228 | 1229 |
throws IOException |
1229 | 1230 |
{ |
1230 |
ByteArrayInputStream bais = new ByteArrayInputStream(s.getBytes()); |
|
1231 |
ByteArrayInputStream bais = new ByteArrayInputStream(s.getBytes(MetaCatServlet.DEFAULT_ENCODING));
|
|
1231 | 1232 |
return bais; |
1232 | 1233 |
} |
1233 | 1234 |
|
... | ... | |
1411 | 1412 |
|
1412 | 1413 |
writeString = s.substring(0, result[0]); |
1413 | 1414 |
//System.out.println("writing1: " + writeString); |
1414 |
fos.write(writeString.getBytes()); |
|
1415 |
fos.write(writeString.getBytes(MetaCatServlet.DEFAULT_ENCODING));
|
|
1415 | 1416 |
//we're done. break and return; |
1416 | 1417 |
return s.substring(result[0] + result[1], s.length()); |
1417 | 1418 |
} |
... | ... | |
1436 | 1437 |
if(searchForBoundary) |
1437 | 1438 |
{ |
1438 | 1439 |
//System.out.println("writing2: " + s); |
1439 |
fos.write(s.getBytes()); |
|
1440 |
fos.write(s.getBytes(MetaCatServlet.DEFAULT_ENCODING));
|
|
1440 | 1441 |
} |
1441 | 1442 |
numread = is.read(b, 0, 1024); |
1442 | 1443 |
if(numread != -1) |
Also available in: Unified diff
use detected document encoding or Metacat's default encoding (UTF-8)