brooklyn.entity.drivers.downloads.BasicDownloadResolver Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of brooklyn-core Show documentation
Show all versions of brooklyn-core Show documentation
Entity implementation classes, events, and other core elements
package brooklyn.entity.drivers.downloads;
import static com.google.common.base.Preconditions.checkNotNull;
import java.util.List;
import com.google.common.base.Objects;
import com.google.common.collect.ImmutableList;
public class BasicDownloadResolver implements DownloadResolver {
private final List targets;
private final String filename;
private final String unpackDirectoryName;
public BasicDownloadResolver(Iterable targets, String filename) {
this(targets, filename, null);
}
public BasicDownloadResolver(Iterable targets, String filename, String unpackDirectoryName) {
this.targets = ImmutableList.copyOf(checkNotNull(targets, "targets"));
this.filename = checkNotNull(filename, "filename");
this.unpackDirectoryName = unpackDirectoryName;
}
@Override
public List getTargets() {
return targets;
}
@Override
public String getFilename() {
return filename;
}
@Override
public String getUnpackedDirectoryName(String defaultVal) {
return unpackDirectoryName == null ? defaultVal : unpackDirectoryName;
}
@Override
public String toString() {
return Objects.toStringHelper(this).add("targets", targets).add("filename", filename)
.add("unpackDirName", unpackDirectoryName).omitNullValues().toString();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy