X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=cms%2Forg.argeo.slc.spring%2Fsrc%2Forg%2Fargeo%2Fslc%2Fcore%2Fexecution%2FExecutionResources.java;fp=cms%2Forg.argeo.slc.spring%2Fsrc%2Forg%2Fargeo%2Fslc%2Fcore%2Fexecution%2FExecutionResources.java;h=772330a78c553fda0547c89e6a69c81d88f227fa;hb=ecc22e604e47533c79de9cecdcdeacbc752cbff1;hp=0000000000000000000000000000000000000000;hpb=e07ded4632e53f8b8869763bc1f1f4091361e76e;p=gpl%2Fargeo-slc.git diff --git a/cms/org.argeo.slc.spring/src/org/argeo/slc/core/execution/ExecutionResources.java b/cms/org.argeo.slc.spring/src/org/argeo/slc/core/execution/ExecutionResources.java new file mode 100644 index 000000000..772330a78 --- /dev/null +++ b/cms/org.argeo.slc.spring/src/org/argeo/slc/core/execution/ExecutionResources.java @@ -0,0 +1,33 @@ +package org.argeo.slc.core.execution; + +import java.io.File; + +import org.springframework.core.io.Resource; + +/** 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 Resource 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(Resource resource, Boolean overwrite); +}