1225 |
1225 |
{
|
1226 |
1226 |
Logger logMetacat = Logger.getLogger(ResourceHandler.class);
|
1227 |
1227 |
logMetacat.info("writing MMP parts");
|
1228 |
|
String s = beginSearch;
|
|
1228 |
//String s = beginSearch;
|
|
1229 |
String s = null;
|
1229 |
1230 |
FileOutputStream fos = new FileOutputStream(f);
|
1230 |
1231 |
int numread = 0;
|
1231 |
1232 |
byte[] b = new byte[1024];
|
... | ... | |
1237 |
1238 |
s = new String(b, 0, numread);
|
1238 |
1239 |
}
|
1239 |
1240 |
|
|
1241 |
if(beginSearch != null)
|
|
1242 |
{
|
|
1243 |
s = beginSearch + s;
|
|
1244 |
}
|
|
1245 |
|
1240 |
1246 |
boolean useCurrentS = true;
|
1241 |
1247 |
boolean searchForBoundary = false;
|
1242 |
1248 |
String seekString = searchString;
|
... | ... | |
1246 |
1252 |
logMetacat.info("////////////////////////iterating");
|
1247 |
1253 |
logMetacat.info("searchForBoundary: " + searchForBoundary);
|
1248 |
1254 |
logMetacat.info("useCurrentS: " + useCurrentS);
|
|
1255 |
logMetacat.info("seekString: " + seekString);
|
|
1256 |
logMetacat.info("in string: " + s);
|
1249 |
1257 |
if(searchForBoundary)
|
1250 |
1258 |
{
|
1251 |
1259 |
seekString = boundary;
|
... | ... | |
1269 |
1277 |
}
|
1270 |
1278 |
}
|
1271 |
1279 |
|
1272 |
|
logMetacat.info("seekString: " + seekString);
|
1273 |
|
logMetacat.info("in string: " + s);
|
|
1280 |
logMetacat.info("2seekString: " + seekString);
|
|
1281 |
logMetacat.info("2in string: " + s);
|
1274 |
1282 |
|
1275 |
1283 |
if(result[0] >= 0 && result[1] == seekString.length())
|
1276 |
1284 |
{
|
... | ... | |
1355 |
1363 |
//System.out.println("==========================Looking for SM");
|
1356 |
1364 |
//System.out.println("writing sm to " + fileArr[0].getAbsolutePath());
|
1357 |
1365 |
logMetacat.info("writing mime system metadata to " + fileArr[0].getAbsolutePath());
|
1358 |
|
s = writeMMPPartToFile(s, is, boundary, searchStrings[0], fileArr[0]);
|
|
1366 |
s = writeMMPPartToFile(s.trim(), is, boundary, searchStrings[0], fileArr[0]);
|
|
1367 |
logMetacat.info("writeMMPPartToFile returned '" + s.trim() + "' after processing the system metadata");
|
1359 |
1368 |
//System.out.println("==========================Looking for Object");
|
1360 |
1369 |
//System.out.println("writing obj to " + fileArr[1].getAbsolutePath());
|
1361 |
1370 |
logMetacat.info("writing mime object to " + fileArr[1].getAbsolutePath());
|
1362 |
|
writeMMPPartToFile(s, is, boundary, searchStrings[1], fileArr[1]);
|
|
1371 |
writeMMPPartToFile(s.trim(), is, boundary, searchStrings[1], fileArr[1]);
|
1363 |
1372 |
h.put("sysmeta", fileArr[0]);
|
1364 |
1373 |
h.put("object", fileArr[1]);
|
1365 |
1374 |
return h;
|
... | ... | |
1423 |
1432 |
|
1424 |
1433 |
try
|
1425 |
1434 |
{
|
1426 |
|
parts = processMMP(request.getInputStream());
|
|
1435 |
//String req = IOUtils.toString(request.getInputStream());
|
|
1436 |
//System.out.println("request: " + req);
|
|
1437 |
//InputStream reqStr = IOUtils.toInputStream(req);
|
|
1438 |
InputStream reqStr = request.getInputStream();
|
|
1439 |
parts = processMMP(reqStr);
|
1427 |
1440 |
object = new FileInputStream(parts.get("object"));
|
1428 |
1441 |
sysmeta = new FileInputStream(parts.get("sysmeta"));
|
|
1442 |
|
|
1443 |
String obj = IOUtils.toString(object);
|
|
1444 |
String sm = IOUtils.toString(sysmeta);
|
|
1445 |
System.out.println("object: " + obj);
|
|
1446 |
System.out.println("sm: " + sm);
|
|
1447 |
object = IOUtils.toInputStream(obj);
|
|
1448 |
sysmeta = IOUtils.toInputStream(sm);
|
1429 |
1449 |
}
|
1430 |
1450 |
catch(IOException ioe)
|
1431 |
1451 |
{
|
got getChecksum working. working on delete now. all tests in d1clienttest now pass