Class | Line # | Actions | |||||
---|---|---|---|---|---|---|---|
TemporaryResourceStore | 39 | 0 | - | 0 | 0 |
1 | /* | |
2 | * See the NOTICE file distributed with this work for additional | |
3 | * information regarding copyright ownership. | |
4 | * | |
5 | * This is free software; you can redistribute it and/or modify it | |
6 | * under the terms of the GNU Lesser General Public License as | |
7 | * published by the Free Software Foundation; either version 2.1 of | |
8 | * the License, or (at your option) any later version. | |
9 | * | |
10 | * This software is distributed in the hope that it will be useful, | |
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 | * Lesser General Public License for more details. | |
14 | * | |
15 | * You should have received a copy of the GNU Lesser General Public | |
16 | * License along with this software; if not, write to the Free | |
17 | * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | |
18 | * 02110-1301 USA, or see the FSF site: http://www.fsf.org. | |
19 | */ | |
20 | package org.xwiki.resource.temporary; | |
21 | ||
22 | import java.io.File; | |
23 | import java.io.IOException; | |
24 | import java.io.InputStream; | |
25 | ||
26 | import org.xwiki.component.annotation.Role; | |
27 | import org.xwiki.stability.Unstable; | |
28 | ||
29 | /** | |
30 | * Interface used to read and write temporary resources. | |
31 | * | |
32 | * @version $Id: 8f9833c5077cc20c7d26aa2de153b5fd48ac6ef3 $ | |
33 | * @since 7.4.6 | |
34 | * @since 8.2.2 | |
35 | * @since 8.3 | |
36 | */ | |
37 | @Role | |
38 | @Unstable | |
39 | public interface TemporaryResourceStore | |
40 | { | |
41 | /** | |
42 | * Create a new temporary file with the specified content. | |
43 | * | |
44 | * @param reference the temporary resource reference | |
45 | * @param content the content of the temporary file | |
46 | * @return the created temporary file | |
47 | * @throws IOException if creating the temporary file fails | |
48 | */ | |
49 | File createTemporaryFile(TemporaryResourceReference reference, InputStream content) throws IOException; | |
50 | ||
51 | /** | |
52 | * Get the temporary file associated to the specified resource reference. | |
53 | * | |
54 | * @param reference the temporary resource reference | |
55 | * @return the temporary file associated to the specified resource reference | |
56 | * @throws IOException if the resource path is invalid | |
57 | */ | |
58 | File getTemporaryFile(TemporaryResourceReference reference) throws IOException; | |
59 | } |