KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > geronimo > kernel > repository > WriteableRepository


1 /**
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */

17 package org.apache.geronimo.kernel.repository;
18
19 import java.io.File JavaDoc;
20 import java.io.IOException JavaDoc;
21 import java.io.InputStream JavaDoc;
22
23 /**
24  * A repository that accepts new entries.
25  *
26  * @version $Rev: 476457 $ $Date: 2006-11-18 01:49:20 -0500 (Sat, 18 Nov 2006) $
27  */

28 public interface WriteableRepository extends Repository {
29     /**
30      * Copies a file from the server's filesystem into the repository.
31      * Obviously to use this remotely, you must have some other way
32      * to upload the file to the server's filesystem, even if the
33      * the server is just going to turn around and upload it to some
34      * other remote location.
35      *
36      * @param source A file representing the data for the new repository
37      * entry
38      * @param destination A fully-resolved artifact that tells the repository
39      * where it should save the data to
40      * @param monitor Tracks the progress of the installation
41      */

42     public void copyToRepository(File JavaDoc source, Artifact destination, FileWriteMonitor monitor) throws IOException JavaDoc;
43
44     /**
45      * Copies the contents of an arbitrary stream into the repository.
46      * Obviously to use this remotely, you must have some other way
47      * to upload the content to the server's JVM, even if the the server
48      * is just going to turn around and upload it to some other remote
49      * location. The source will be closed when the write completes.
50      *
51      * @param source A stream representing the data for the new
52      * repository entry
53      * @param destination A fully-resolved artifact that tells the repository
54      * where it should save the data to
55      * @param monitor Tracks the progress of the installation
56      */

57     public void copyToRepository(InputStream JavaDoc source, int size, Artifact destination, FileWriteMonitor monitor) throws IOException JavaDoc;
58 }
59
Popular Tags