Skip to content

Commit

Permalink
#148 fixes for path guessing
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-conway committed Sep 15, 2015
1 parent 8f33c22 commit b73f1b7
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,7 @@ Updated semantics of move collection to avoid 'collection already exists errors'
### Rename operation in DTO #147

Added a rename() operation to DataTransferOperations to clarify difference between a rename and a move

### CollectionPager not navigating strict acl dirs with heuristics #148

Add heuristic path guessing to CollectionPagerAO, which is an upgrade of the old CollectionAndDataObjectListAndSearchAOImpl
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,12 @@ List<CollectionAndDataObjectListingEntry> listCollectionsUnderPath(
*/
MiscIRODSUtils.evaluateSpecCollSupport(objStat);

if (objStat.isStandInGeneratedObjStat()) {
log.info("this objStat was heuristically generated, create stand-in subdirs if needed");
return handleNoListingUnderRootOrHomeByLookingForPublicAndHome(objStat
.getAbsolutePath());
}

/*
* Special collections are processed in different ways.
*
Expand Down Expand Up @@ -1183,24 +1189,18 @@ ObjStat retrieveObjectStatForPath(final String irodsAbsolutePath)
"irodsAbsolutePath is null or empty");
}

/*
* StopWatch stopWatch = null;
*
* if (this.isInstrumented()) { stopWatch = new
* Log4JStopWatch("retrieveObjectStatForPath"); }
*/

MiscIRODSUtils.checkPathSizeForMax(irodsAbsolutePath);

DataObjInpForObjStat dataObjInp = DataObjInpForObjStat
.instance(irodsAbsolutePath);
Tag response;
ObjStat objStat;
try {
response = irodsAccessObjectFactory.getIrodsSession()
.currentConnection(irodsAccount).irodsFunction(dataObjInp);
} catch (DataNotFoundException e) {
log.info("rethrow DataNotFound as FileNotFound per contract");
throw new FileNotFoundException(e);
} catch (FileNotFoundException e) {
log.info("got a file not found, try to heuristically produce an objstat");
return handleNoObjStatUnderRootOrHomeByLookingForPublicAndHome(irodsAbsolutePath);
}

log.debug("response from objStat: {}", response.parseTag());
Expand All @@ -1209,7 +1209,7 @@ ObjStat retrieveObjectStatForPath(final String irodsAbsolutePath)
* For spec cols - soft link - phyPath = parent canonical dir -objPath =
* canonical path
*/
ObjStat objStat = new ObjStat();
objStat = new ObjStat();
objStat.setAbsolutePath(irodsAbsolutePath);
objStat.setChecksum(response.getTag("chksum").getStringValue());
objStat.setDataId(response.getTag("dataId").getIntValue());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ public PagingAwareCollectionListing retrieveFirstPageUnderParent(
final String irodsAbsolutePath) throws FileNotFoundException,
NoMoreDataException, JargonException {

log.info("initialListingUnderParent()");
log.info("retrieveFirstPageUnderParent()");

if (irodsAbsolutePath == null || irodsAbsolutePath.isEmpty()) {
throw new IllegalArgumentException(
Expand Down

0 comments on commit b73f1b7

Please sign in to comment.