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 @ 1405

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 = "osx";
61
                static final String OSX_10_4 = "osx";
62
                static final String OSX_10_5 = "osx";
63
                static final String OSX_10_6 = "osx";
64
                static final String OSX_10_7 = "osx";
65
                static final String OSX_10_8 = "osx";
66
                static final String OSX_10_9 = "osx";
67
        }
68

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

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

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

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

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

    
99
        /**
100
         * Create a empty PackageInfo instance
101
         *
102
         * @return the package info
103
         */
104
        public PackageInfo createPackageInfo();
105

    
106
        /**
107
         * Create a PackageInfo and load contents from the specified InputStream using the
108
         * default reader.
109
         *
110
         * @param packegeinfo as URL
111
         * @return the created packageInfo
112
         * @throws BaseException
113
         */
114
        public PackageInfo createPackageInfo(InputStream packegeinfo) throws BaseException;
115

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

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

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

    
133
        public Dependencies createDependencies();
134

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

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

    
149

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

    
152
        public void writePacakgeInfo(PackageInfo pkg, OutputStream os) throws IOException ;
153

    
154
        public void readPacakgeInfo(PackageInfo packageInfo, File file) throws IOException ;
155

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