use of net.sf.webdav.StoredObject in project indy by Commonjava.
the class ArtifactStoreSubStore method getStoredObject.
@Override
public StoredObject getStoredObject(final ITransaction transaction, final String uri) throws WebdavException {
final StoredObject so = new StoredObject();
final StoreURIMatcher matcher = new StoreURIMatcher(uri);
if (matcher.hasStorePath()) {
final Transfer item = getTransfer(matcher);
if (item == null) {
return null;
}
so.setCreationDate(new Date(item.lastModified()));
so.setLastModified(new Date(item.lastModified()));
so.setFolder(item.isDirectory());
so.setResourceLength(item.length());
} else {
final Date d = new Date();
so.setCreationDate(d);
so.setLastModified(d);
so.setFolder(true);
}
return so;
}
use of net.sf.webdav.StoredObject in project indy by Commonjava.
the class DotMavenStore method getStoredObject.
@Override
public StoredObject getStoredObject(final ITransaction transaction, final String uri) throws WebdavException {
// final HttpSession session = requestInfo.getRequest()
// .getSession();
// if ( session != null )
// {
// logger.info( "mount point: {}", session.getAttribute( RequestInfo.MOUNT_POINT ) );
// }
// else
// {
// logger.info( "No session available" );
// }
logger.info("get stored object: {}, {}", transaction, uri);
final SubStore store = select(uri);
if (store != null) {
logger.info("Returning stored object from sub-store: {}", store);
return store.getStoredObject(transaction, uri);
}
final StoredObject so = new StoredObject();
so.setFolder(true);
final Date d = new Date();
so.setCreationDate(d);
so.setLastModified(d);
return so;
}
use of net.sf.webdav.StoredObject in project indy by Commonjava.
the class SettingsSubStore method getStoredObject.
@Override
public StoredObject getStoredObject(final ITransaction transaction, final String uri) throws WebdavException {
final StoredObject so = new StoredObject();
final Date d = new Date();
so.setCreationDate(d);
so.setLastModified(d);
final SettingsURIMatcher matcher = new SettingsURIMatcher(uri);
if (matcher.isSettingsFileResource()) {
so.setFolder(false);
final SettingsTemplate st = getSettingsTemplate(matcher);
so.setResourceLength(st.getLength());
} else {
so.setFolder(true);
}
return so;
}
Aggregations