]> git.argeo.org Git - gpl/argeo-slc.git/blob - runtime/org.argeo.slc.core/src/main/java/org/argeo/slc/core/deploy/MultiResourceSet.java
Save current state even if not completely stable
[gpl/argeo-slc.git] / runtime / org.argeo.slc.core / src / main / java / org / argeo / slc / core / deploy / MultiResourceSet.java
1 /*
2 * Copyright (C) 2010 Mathieu Baudier <mbaudier@argeo.org>
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17 package org.argeo.slc.core.deploy;
18
19 import java.util.ArrayList;
20 import java.util.HashMap;
21 import java.util.List;
22 import java.util.Map;
23
24 import org.springframework.core.io.Resource;
25
26 public class MultiResourceSet implements ResourceSet {
27 private List<ResourceSet> resourceSets = new ArrayList<ResourceSet>();
28
29 public Map<String, Resource> listResources() {
30 Map<String, Resource> res = new HashMap<String, Resource>();
31 for (ResourceSet resourceSet : resourceSets) {
32 res.putAll(resourceSet.listResources());
33 }
34 return res;
35 }
36
37 /** Last listed override previous for the same relative paths. */
38 public void setResourceSets(List<ResourceSet> resourceSets) {
39 this.resourceSets = resourceSets;
40 }
41
42 public List<ResourceSet> getResourceSets() {
43 return resourceSets;
44 }
45
46 }