use of org.dcache.util.list.ListDirectoryHandler in project dcache by dCache.
the class DirectoryLookUpPool method starting.
@Override
protected void starting() throws Exception {
_log.info("Lookup Pool {} starting", _poolName);
super.starting();
_pnfs = new PnfsHandler(this, _pnfsManager);
ListDirectoryHandler listHandler = new ListDirectoryHandler(_pnfs);
addMessageListener(listHandler);
_list = listHandler;
useInterpreter(true);
}
use of org.dcache.util.list.ListDirectoryHandler in project dcache by dCache.
the class AbstractFtpDoorV1 method acceptLogin.
protected void acceptLogin(Subject mappedSubject, Set<LoginAttribute> loginAttributes, Restriction restriction, FsPath doorRootPath) {
FsPath userRootPath = FsPath.ROOT;
String userHomePath = "/";
for (LoginAttribute attribute : loginAttributes) {
if (attribute instanceof RootDirectory) {
userRootPath = FsPath.create(((RootDirectory) attribute).getRoot());
} else if (attribute instanceof HomeDirectory) {
userHomePath = ((HomeDirectory) attribute).getHome();
} else if (attribute instanceof MaxUploadSize) {
long max = ((MaxUploadSize) attribute).getMaximumSize();
if (!_maximumUploadSize.isPresent() || max < _maximumUploadSize.getAsLong()) {
_maximumUploadSize = OptionalLong.of(max);
}
}
}
_authz = Restrictions.concat(_doorRestriction, restriction);
String cwd;
if (doorRootPath == null) {
doorRootPath = userRootPath;
cwd = userHomePath;
} else {
if (userRootPath.hasPrefix(doorRootPath)) {
cwd = userRootPath.chroot(userHomePath).stripPrefix(doorRootPath);
} else {
cwd = "/";
}
}
_pnfs = _settings.createPnfsHandler(_cellEndpoint);
_pnfs.setSubject(mappedSubject);
_pnfs.setRestriction(_authz);
_listSource = new ListDirectoryHandler(_pnfs);
_subject = mappedSubject;
_cwd = cwd;
_doorRootPath = doorRootPath;
_userRootPath = userRootPath;
_userHomePath = FsPath.create(userHomePath);
_identityResolver = _identityResolverFactory.withSubject(mappedSubject);
}
use of org.dcache.util.list.ListDirectoryHandler in project dcache by dCache.
the class RemoteNameSpaceProviderTests method setup.
@Before
public void setup() throws NoSuchMethodException {
_endpoint = mock(CellEndpoint.class);
CellStub stub = new CellStub(_endpoint, CELLPATH_PNFSMANAGER);
PnfsHandler pnfs = new PnfsHandler(stub);
_listHandler = new ListDirectoryHandler(pnfs);
_namespace = new RemoteNameSpaceProvider(pnfs, _listHandler);
}
use of org.dcache.util.list.ListDirectoryHandler in project dcache by dCache.
the class BulkMultipleTargetJobTest method setup.
@Before
public void setup() throws Exception {
fileTree = HashMultimap.create();
attributesMap = new HashMap<>();
loadEntries();
pnfsHandler = new TestPnfsHandler();
listDirectoryHandler = new ListDirectoryHandler(pnfsHandler);
submissionHandler = mock(BulkSubmissionHandler.class);
completionHandler = new BulkJobCompletionHandler(this);
}
Aggregations