X-Git-Url: https://git.argeo.org/?a=blobdiff_plain;f=org.argeo.api.slc%2Fsrc%2Forg%2Fargeo%2Fapi%2Fslc%2Fexecution%2FExecutionResources.java;fp=org.argeo.api.slc%2Fsrc%2Forg%2Fargeo%2Fapi%2Fslc%2Fexecution%2FExecutionResources.java;h=6026912ef76e03ef58a2e8fdc3a8ae1c41c3f31c;hb=d07cf3c7dfdeafa2b1efafe547b54d56a8b52ced;hp=0000000000000000000000000000000000000000;hpb=8596685647867307b862b8a89742b6a62ba75fcd;p=gpl%2Fargeo-slc.git diff --git a/org.argeo.api.slc/src/org/argeo/api/slc/execution/ExecutionResources.java b/org.argeo.api.slc/src/org/argeo/api/slc/execution/ExecutionResources.java new file mode 100644 index 000000000..6026912ef --- /dev/null +++ b/org.argeo.api.slc/src/org/argeo/api/slc/execution/ExecutionResources.java @@ -0,0 +1,31 @@ +package org.argeo.api.slc.execution; + +import java.io.File; +import java.nio.file.Path; + +/** Provides write access to resources during execution */ +public interface ExecutionResources { + /** The base directory where this execution can write */ + public File getWritableBaseDir(); + + /** Allocates a local file in the writable area and return it as a resource. */ + public Path getWritableResource(String relativePath); + + /** + * Allocates a local file in the writable area and return it as a fully + * qualified OS path. + */ + public String getWritableOsPath(String relativePath); + + /** + * Allocates a local file in the writable area and return it as a {@link File}. + */ + public File getWritableOsFile(String relativePath); + + /** + * Returns the resource as a file path. If the resource is not writable it is + * copied as a file in the writable area and the path to this local file is + * returned. + */ + public String getAsOsPath(Path resource, Boolean overwrite); +}