]> git.argeo.org Git - gpl/argeo-slc.git/blob - runtime/org.argeo.slc.core/src/main/java/org/argeo/slc/core/build/ResourceDistribution.java
Simplify minimal configs for execution
[gpl/argeo-slc.git] / runtime / org.argeo.slc.core / src / main / java / org / argeo / slc / core / build / ResourceDistribution.java
1 package org.argeo.slc.core.build;
2
3 import java.io.IOException;
4 import java.io.InputStream;
5
6 import org.argeo.slc.SlcException;
7 import org.argeo.slc.StreamReadable;
8 import org.argeo.slc.build.Distribution;
9 import org.springframework.core.io.Resource;
10
11 public class ResourceDistribution implements Distribution, StreamReadable {
12 private Resource location;
13
14 public ResourceDistribution() {
15 }
16
17 public ResourceDistribution(Resource location) {
18 this.location = location;
19 }
20
21 public String getDistributionId() {
22 return location.toString();
23 }
24
25 public Resource getLocation() {
26 return location;
27 }
28
29 public void setLocation(Resource location) {
30 this.location = location;
31 }
32
33 public InputStream getInputStream() {
34 try {
35 return location.getInputStream();
36 } catch (IOException e) {
37 throw new SlcException("Cannot get input stream", e);
38 }
39 }
40
41 }