org.rundeck.storage.impl.EmptyTree Maven / Gradle / Ivy
package org.rundeck.storage.impl;
import org.rundeck.storage.api.ContentMeta;
import org.rundeck.storage.api.Path;
import org.rundeck.storage.api.Resource;
import org.rundeck.storage.api.StorageException;
import java.util.Set;
/**
* Empty tree which has no content and throws exceptions.
*/
public class EmptyTree extends StringToPathTree {
@Override
public boolean hasPath(Path path) {
return false;
}
@Override
public boolean hasResource(Path path) {
return false;
}
@Override
public boolean hasDirectory(Path path) {
return false;
}
@Override
public Resource getPath(Path path) {
throw StorageException.readException(path, "Empty: no resource or directory for path: " + path);
}
@Override
public Resource getResource(Path path) {
throw StorageException.readException(path, "Empty: no resource for path: " + path);
}
@Override
public Set> listDirectoryResources(Path path) {
throw StorageException.listException(path, "Empty: no resource for path: " + path);
}
@Override
public Set> listDirectory(Path path) {
throw StorageException.listException(path, "Empty: no resource for path: " + path);
}
@Override
public Set> listDirectorySubdirs(Path path) {
throw StorageException.listException(path, "Empty: no resource for path: " + path);
}
@Override
public boolean deleteResource(Path path) {
throw StorageException.deleteException(path, "Empty: no resource for path: " + path);
}
@Override
public Resource createResource(Path path, T content) {
throw StorageException.createException(path, "Empty: cannot create resource: " + path);
}
@Override
public Resource updateResource(Path path, T content) {
throw StorageException.updateException(path, "Empty: no resource for path: " + path);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy