]> WPIA git - gigi.git/blob - lib/jetty/org/eclipse/jetty/util/resource/EmptyResource.java
updating jetty to jetty-9.2.16.v2016040
[gigi.git] / lib / jetty / org / eclipse / jetty / util / resource / EmptyResource.java
1 //
2 //  ========================================================================
3 //  Copyright (c) 1995-2016 Mort Bay Consulting Pty. Ltd.
4 //  ------------------------------------------------------------------------
5 //  All rights reserved. This program and the accompanying materials
6 //  are made available under the terms of the Eclipse Public License v1.0
7 //  and Apache License v2.0 which accompanies this distribution.
8 //
9 //      The Eclipse Public License is available at
10 //      http://www.eclipse.org/legal/epl-v10.html
11 //
12 //      The Apache License v2.0 is available at
13 //      http://www.opensource.org/licenses/apache2.0.php
14 //
15 //  You may elect to redistribute this code under either of these licenses.
16 //  ========================================================================
17 //
18
19 package org.eclipse.jetty.util.resource;
20
21 import java.io.File;
22 import java.io.IOException;
23 import java.io.InputStream;
24 import java.net.MalformedURLException;
25 import java.net.URL;
26 import java.nio.channels.ReadableByteChannel;
27
28 /**
29  * EmptyResource
30  *
31  * Represents a resource that does does not refer to any file, url, jar etc. 
32  */
33 public class EmptyResource extends Resource
34 {
35     public static final Resource INSTANCE = new EmptyResource();
36     
37     private EmptyResource()
38     {
39     }
40
41     @Override
42     public boolean isContainedIn(Resource r) throws MalformedURLException
43     {
44         return false;
45     }
46
47     @Override
48     public void close()
49     {
50     }
51
52     @Override
53     public boolean exists()
54     {
55         return false;
56     }
57
58     @Override
59     public boolean isDirectory()
60     {
61         return false;
62     }
63
64     @Override
65     public long lastModified()
66     {
67         return 0;
68     }
69
70     @Override
71     public long length()
72     {
73         return 0;
74     }
75
76     @Override
77     public URL getURL()
78     {
79         return null;
80     }
81
82     @Override
83     public File getFile() throws IOException
84     {
85         return null;
86     }
87
88     @Override
89     public String getName()
90     {
91         return null;
92     }
93
94     @Override
95     public InputStream getInputStream() throws IOException
96     {
97         return null;
98     }
99
100     @Override
101     public ReadableByteChannel getReadableByteChannel() throws IOException
102     {
103         return null;
104     }
105
106     @Override
107     public boolean delete() throws SecurityException
108     {
109         return false;
110     }
111
112     @Override
113     public boolean renameTo(Resource dest) throws SecurityException
114     {
115         return false;
116     }
117
118     @Override
119     public String[] list()
120     {
121         return null;
122     }
123
124     @Override
125     public Resource addPath(String path) throws IOException, MalformedURLException
126     {
127         return null;
128     }
129
130 }