KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > de > schlichtherle > io > AbstractArchiveDetector


1 /*
2  * AbstractArchiveDetector.java
3  *
4  * Created on 23. Maerz 2006, 14:20
5  */

6 /*
7  * Copyright 2006 Schlichtherle IT Services
8  *
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  * http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  */

21
22 package de.schlichtherle.io;
23
24 import java.io.FileNotFoundException JavaDoc;
25 import java.net.URI JavaDoc;
26
27 /**
28  * Implements the {@link FileFactory} part of the {@link ArchiveDetector}
29  * interface.
30  *
31  * @author Christian Schlichtherle
32  * @version @version@
33  * @since TrueZIP 6.0
34  */

35 public abstract class AbstractArchiveDetector implements ArchiveDetector {
36
37     public File createFile(java.io.File JavaDoc blueprint) {
38         return new File(blueprint, this);
39     }
40
41
42     public File createFile(java.io.File JavaDoc delegate, File innerArchive) {
43         return new File(delegate, innerArchive, this);
44     }
45
46
47     public File createFile(
48             File blueprint,
49             java.io.File JavaDoc delegate,
50             File enclArchive) {
51         return new File(blueprint, delegate, enclArchive);
52     }
53
54
55     public File createFile(java.io.File JavaDoc parent, String JavaDoc child) {
56         return new File(parent, child, this);
57     }
58
59
60     public File createFile(String JavaDoc pathName) {
61         return new File(pathName, this);
62     }
63
64
65     public File createFile(String JavaDoc parent, String JavaDoc child) {
66         return new File(parent, child, this);
67     }
68
69
70     public File createFile(URI JavaDoc uri) {
71         return new File(uri, this);
72     }
73
74
75     public FileInputStream createFileInputStream(java.io.File JavaDoc file)
76     throws FileNotFoundException JavaDoc {
77         return new FileInputStream(file);
78     }
79
80
81     public FileOutputStream createFileOutputStream(
82             java.io.File JavaDoc file,
83             boolean append)
84     throws FileNotFoundException JavaDoc {
85         return new FileOutputStream(file, append);
86     }
87 }
88
Popular Tags