Reverted to use FileInputStream Signed-off-by: Greg Wilkins <gregw@webtide.com>
This commit is contained in:
parent
5c91e44eaf
commit
f84337d5b2
|
@ -19,6 +19,7 @@
|
||||||
package org.eclipse.jetty.util.resource;
|
package org.eclipse.jetty.util.resource;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import java.io.FileInputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.net.MalformedURLException;
|
import java.net.MalformedURLException;
|
||||||
|
@ -378,14 +379,9 @@ public class PathResource extends Resource
|
||||||
@Override
|
@Override
|
||||||
public InputStream getInputStream() throws IOException
|
public InputStream getInputStream() throws IOException
|
||||||
{
|
{
|
||||||
/* Mimic behavior from old FileResource class and its
|
// Use a FileInputStream rather than Files.newInputStream(path)
|
||||||
* usage of java.io.FileInputStream(File) which will trigger
|
// since it produces a stream with a fast skip implementation
|
||||||
* an IOException on construction if the path is a directory
|
return new FileInputStream(getFile());
|
||||||
*/
|
|
||||||
if (Files.isDirectory(path))
|
|
||||||
throw new IOException(path + " is a directory");
|
|
||||||
|
|
||||||
return Files.newInputStream(path, StandardOpenOption.READ);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue