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

History | View | Annotate | Download (3.18 KB)

1
package org.gvsig.tools.packageutils;
2

    
3
import java.io.File;
4
import java.io.IOException;
5
import java.io.InputStream;
6
import java.io.OutputStream;
7

    
8
import org.gvsig.tools.exception.BaseException;
9

    
10
public interface PackageManager {
11
        
12
        public static final String PACKAGE_EXTENSION = ".gvspkg";
13
        
14
        /**
15
         * Package state default values.
16
         */
17
        public static interface STATE {
18

    
19
                static final String DEVEL = "devel";
20
                static final String TESTING = "testing";
21
                static final String PILOT = "pilot";
22
                static final String PROTOTYPE = "prototype";
23
                static final String ALPHA = "alpha";
24
                static final String BETA = "beta";
25
                static final String RC = "RC";
26
                static final String FINAL = "final";
27
        }
28

    
29
        /**
30
         * Supported operating system default values.
31
         */
32
        public static interface OS {
33

    
34
                static final String ALL = "all";
35
                static final String LINUX = "lin";
36
                static final String WINDOWS = "win";
37
                static final String OSX_10_4 = "osx_10_4";
38
                static final String OSX_10_5 = "osx_10_5";
39
                static final String OSX_10_6 = "osx_10_6";
40
                static final String OSX_10_7 = "osx_10_7";
41
                static final String OSX_10_8 = "osx_10_8";
42
                static final String OSX_10_9 = "osx_10_9";
43
        }
44

    
45
        /**
46
         * Supported architecture default values.
47
         */
48
        public static interface ARCH {
49

    
50
                static final String ALL = "all";
51
                static final String X86 = "x86";
52
                static final String X86_64 = "x86_64";
53
                static final String PowerPC = "PowerPC";
54
        }
55

    
56
        /**
57
         * Supported Java virtual machine version default values.
58
         */
59
        public static interface JVM {
60

    
61
                static final String J1_5 = "j1_5";
62
                static final String J1_6 = "j1_6";
63
                static final String J1_7 = "j1_7";
64
                static final String J1_8 = "j1_8";
65
        }
66

    
67
        /**
68
         * Create a empty Version instance
69
         * 
70
         * @return the version
71
         */
72
        public Version createVersion();
73

    
74
        /**
75
         * Create a empty PackageInfo instance
76
         * 
77
         * @return the package info
78
         */
79
        public PackageInfo createPackageInfo();
80
        
81
        /**
82
         * Create a PackageInfo and load contents from the specified InputStream using the
83
         * default reader.
84
         * 
85
         * @param packegeinfo as URL
86
         * @return the created packageInfo
87
         * @throws BaseException 
88
         */
89
        public PackageInfo createPackageInfo(InputStream packegeinfo) throws BaseException;
90

    
91
        public PackageInfo createPackageInfo(File packegeinfo) throws BaseException;
92

    
93
        /**
94
         * Create a empty dependency object.
95
         * 
96
         * @return the dependency
97
         */
98
        public Dependency createDependency();
99

    
100
        /**
101
         * Create a dependency instance with the data of the package.
102
         * 
103
         * @param packageInfo
104
         * @return a dependency of the package
105
         */
106
        public Dependency createDependency(PackageInfo packageInfo);
107
        
108
        public Dependencies createDependencies();
109

    
110
        /**
111
         * Return the OS code of the system
112
         * 
113
         * @return os code of the system
114
         */
115
        public String getOperatingSystem();
116

    
117
        /**
118
         * Returns the Architecture code of the system
119
         * 
120
         * @return architecture code of the system
121
         */
122
        public String getArchitecture();
123
        
124

    
125
        public void writePacakgeInfo(PackageInfo packageInfo, File file) throws IOException ;
126

    
127
        public void writePacakgeInfo(PackageInfo pkg, OutputStream os) throws IOException ;
128
        
129
        public void readPacakgeInfo(PackageInfo packageInfo, File file) throws IOException ;
130

    
131
        public void readPacakgeInfo(PackageInfo pkg, InputStream os) throws IOException ;
132
}