use of com.yahoo.config.application.api.ApplicationFile in project vespa by vespa-engine.
the class ZooKeeperClient method listFiles.
/**
* Like {@link ApplicationFile#listFiles(com.yahoo.config.application.api.ApplicationFile.PathFilter)} with a slightly different semantic. Never filter out directories.
*/
private List<ApplicationFile> listFiles(ApplicationFile dir, ApplicationFile.PathFilter filter) {
List<ApplicationFile> rawList = dir.listFiles();
List<ApplicationFile> ret = new ArrayList<>();
if (rawList != null) {
for (ApplicationFile f : rawList) {
if (f.isDirectory()) {
ret.add(f);
} else {
if (filter.accept(f.getPath())) {
ret.add(f);
}
}
}
}
return ret;
}
use of com.yahoo.config.application.api.ApplicationFile in project vespa by vespa-engine.
the class SessionContentHandler method getContentRequest.
private SessionContentRequestV2 getContentRequest(HttpRequest request) {
final TenantName tenantName = Utils.getTenantNameFromSessionRequest(request);
validateRequest(tenantName);
long sessionId = getSessionIdV2(request);
String contentPath = SessionContentRequestV2.getContentPath(request);
ApplicationFile applicationFile = applicationRepository.getApplicationFileFromSession(tenantName, sessionId, contentPath, ContentRequest.getApplicationFileMode(request.getMethod()));
return new SessionContentRequestV2(request, sessionId, tenantName, contentPath, applicationFile);
}
use of com.yahoo.config.application.api.ApplicationFile in project vespa by vespa-engine.
the class ZKApplicationFile method listFiles.
@Override
public List<ApplicationFile> listFiles(PathFilter filter) {
String userPath = getZKPath(path);
List<ApplicationFile> ret = new ArrayList<>();
for (String zkChild : zkApp.getChildren(userPath)) {
Path childPath = path.append(zkChild);
// Ignore dot-files.
if (!childPath.getName().startsWith(".") && filter.accept(childPath)) {
ret.add(new ZKApplicationFile(childPath, zkApp));
}
}
return ret;
}
Aggregations