001    /*
002     * Licensed to the Apache Software Foundation (ASF) under one or more
003     * contributor license agreements.  See the NOTICE file distributed with
004     * this work for additional information regarding copyright ownership.
005     * The ASF licenses this file to You under the Apache License, Version 2.0
006     * (the "License"); you may not use this file except in compliance with
007     * the License.  You may obtain a copy of the License at
008     *
009     *      http://www.apache.org/licenses/LICENSE-2.0
010     *
011     * Unless required by applicable law or agreed to in writing, software
012     * distributed under the License is distributed on an "AS IS" BASIS,
013     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014     * See the License for the specific language governing permissions and
015     * limitations under the License.
016     */
017    package org.apache.servicemix.jbi.container;
018    
019    import java.io.File;
020    
021    import org.apache.servicemix.jbi.util.FileUtil;
022    
023    public class ServiceAssemblyEnvironment {
024    
025        private File rootDir;
026        private File installDir;
027        private File susDir;
028        private File stateFile;
029        
030        public ServiceAssemblyEnvironment() {
031        }
032    
033        /**
034         * @return Returns the installRoot.
035         */
036        public File getInstallDir() {
037            return installDir;
038        }
039    
040        /**
041         * @param installRoot The installRoot to set.
042         */
043        public void setInstallDir(File installRoot) {
044            this.installDir = installRoot;
045        }
046    
047        /**
048         * @return Returns the susRoot.
049         */
050        public File getSusDir() {
051            return susDir;
052        }
053    
054        /**
055         * @param susRoot The susRoot to set.
056         */
057        public void setSusDir(File susRoot) {
058            this.susDir = susRoot;
059        }
060    
061        /**
062         * @return Returns the stateFile.
063         */
064        public File getStateFile() {
065            return stateFile;
066        }
067    
068        /**
069         * @param stateFile The stateFile to set.
070         */
071        public void setStateFile(File stateFile) {
072            this.stateFile = stateFile;
073        }
074    
075        /**
076         * @return Returns the rootDir.
077         */
078        public File getRootDir() {
079            return rootDir;
080        }
081    
082        /**
083         * @param rootDir The rootDir to set.
084         */
085        public void setRootDir(File rootDir) {
086            this.rootDir = rootDir;
087        }
088    
089        public File getServiceUnitDirectory(String componentName, String suName) {
090            File compDir = FileUtil.getDirectoryPath(susDir, componentName);
091            return FileUtil.getDirectoryPath(compDir, suName);
092        }
093    
094    }