1 package org
.argeo
.slc
.core
.execution
;
3 import org
.springframework
.beans
.factory
.FactoryBean
;
4 import org
.springframework
.core
.io
.Resource
;
5 import org
.springframework
.util
.Assert
;
7 /** Workaround when execution placedholders needs to be passed. */
8 public class ExecutionResourcesFactoryBean
implements FactoryBean
<Resource
> {
9 private ExecutionResources executionResources
;
10 private String relativePath
;
12 public Resource
getObject() throws Exception
{
13 Assert
.notNull(executionResources
, "executionResources is null");
14 Assert
.notNull(relativePath
, "relativePath is null");
15 return executionResources
.getWritableResource(relativePath
);
18 public Class
<?
extends Object
> getObjectType() {
19 return Resource
.class;
22 public boolean isSingleton() {
26 public void setExecutionResources(ExecutionResources executionResources
) {
27 this.executionResources
= executionResources
;
30 public void setRelativePath(String relativePath
) {
31 this.relativePath
= relativePath
;