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.
9 // The Eclipse Public License is available at
10 // http://www.eclipse.org/legal/epl-v10.html
12 // The Apache License v2.0 is available at
13 // http://www.opensource.org/licenses/apache2.0.php
15 // You may elect to redistribute this code under either of these licenses.
16 // ========================================================================
19 package org.eclipse.jetty.util.resource;
22 import java.io.IOException;
23 import java.io.InputStream;
24 import java.net.MalformedURLException;
26 import java.nio.channels.ReadableByteChannel;
31 * Represents a resource that does does not refer to any file, url, jar etc.
33 public class EmptyResource extends Resource
35 public static final Resource INSTANCE = new EmptyResource();
37 private EmptyResource()
42 public boolean isContainedIn(Resource r) throws MalformedURLException
53 public boolean exists()
59 public boolean isDirectory()
65 public long lastModified()
83 public File getFile() throws IOException
89 public String getName()
95 public InputStream getInputStream() throws IOException
101 public ReadableByteChannel getReadableByteChannel() throws IOException
107 public boolean delete() throws SecurityException
113 public boolean renameTo(Resource dest) throws SecurityException
119 public String[] list()
125 public Resource addPath(String path) throws IOException, MalformedURLException