Statistics
| Revision:

gvsig-tools / org.gvsig.tools / library / trunk / org.gvsig.tools / org.gvsig.tools.lib / src / main / java / org / gvsig / tools / packageutils / PackageManager.java @ 1303

History | View | Annotate | Download (4.16 KB)

1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2013 gvSIG Association.
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 2
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
23
 */
24
package org.gvsig.tools.packageutils;
25

    
26
import java.io.File;
27
import java.io.IOException;
28
import java.io.InputStream;
29
import java.io.OutputStream;
30

    
31
import org.gvsig.tools.exception.BaseException;
32

    
33
public interface PackageManager {
34
        
35
        public static final String PACKAGE_EXTENSION = ".gvspkg";
36
        
37
        /**
38
         * Package state default values.
39
         */
40
        public static interface STATE {
41

    
42
                static final String DEVEL = "devel";
43
                static final String TESTING = "testing";
44
                static final String PILOT = "pilot";
45
                static final String PROTOTYPE = "prototype";
46
                static final String ALPHA = "alpha";
47
                static final String BETA = "beta";
48
                static final String RC = "RC";
49
                static final String FINAL = "final";
50
        }
51

    
52
        /**
53
         * Supported operating system default values.
54
         */
55
        public static interface OS {
56

    
57
                static final String ALL = "all";
58
                static final String LINUX = "lin";
59
                static final String WINDOWS = "win";
60
                static final String OSX_10_4 = "osx_10_4";
61
                static final String OSX_10_5 = "osx_10_5";
62
                static final String OSX_10_6 = "osx_10_6";
63
                static final String OSX_10_7 = "osx_10_7";
64
                static final String OSX_10_8 = "osx_10_8";
65
                static final String OSX_10_9 = "osx_10_9";
66
        }
67

    
68
        /**
69
         * Supported architecture default values.
70
         */
71
        public static interface ARCH {
72

    
73
                static final String ALL = "all";
74
                static final String X86 = "x86";
75
                static final String X86_64 = "x86_64";
76
                static final String PowerPC = "PowerPC";
77
        }
78

    
79
        /**
80
         * Supported Java virtual machine version default values.
81
         */
82
        public static interface JVM {
83

    
84
                static final String J1_5 = "j1_5";
85
                static final String J1_6 = "j1_6";
86
                static final String J1_7 = "j1_7";
87
                static final String J1_8 = "j1_8";
88
        }
89

    
90
        /**
91
         * Create a empty Version instance
92
         * 
93
         * @return the version
94
         */
95
        public Version createVersion();
96
        public Version createVersion(String version);
97

    
98
        /**
99
         * Create a empty PackageInfo instance
100
         * 
101
         * @return the package info
102
         */
103
        public PackageInfo createPackageInfo();
104
        
105
        /**
106
         * Create a PackageInfo and load contents from the specified InputStream using the
107
         * default reader.
108
         * 
109
         * @param packegeinfo as URL
110
         * @return the created packageInfo
111
         * @throws BaseException 
112
         */
113
        public PackageInfo createPackageInfo(InputStream packegeinfo) throws BaseException;
114

    
115
        public PackageInfo createPackageInfo(File packegeinfo) throws BaseException;
116

    
117
        /**
118
         * Create a empty dependency object.
119
         * 
120
         * @return the dependency
121
         */
122
        public Dependency createDependency();
123

    
124
        /**
125
         * Create a dependency instance with the data of the package.
126
         * 
127
         * @param packageInfo
128
         * @return a dependency of the package
129
         */
130
        public Dependency createDependency(PackageInfo packageInfo);
131
        
132
        public Dependencies createDependencies();
133

    
134
        /**
135
         * Return the OS code of the system
136
         * 
137
         * @return os code of the system
138
         */
139
        public String getOperatingSystem();
140

    
141
        /**
142
         * Returns the Architecture code of the system
143
         * 
144
         * @return architecture code of the system
145
         */
146
        public String getArchitecture();
147
        
148

    
149
        public void writePacakgeInfo(PackageInfo packageInfo, File file) throws IOException ;
150

    
151
        public void writePacakgeInfo(PackageInfo pkg, OutputStream os) throws IOException ;
152
        
153
        public void readPacakgeInfo(PackageInfo packageInfo, File file) throws IOException ;
154

    
155
        public void readPacakgeInfo(PackageInfo pkg, InputStream os) throws IOException ;
156
}