Top Description Fields Constructors Methods
org.jruby.util

pack-priv Class JarDirectoryResource

extends JarResource
Class Inheritance
Imports
java.io.IOException, .InputStream, java.nio.channels.Channel, java.nio.file.attribute.FileTime

Represents a directory in a jar.

Jars do not necessarily have to contain entries for a directory. However, from ruby's point of view, if a jar contains entry /foo/bar, it already contains /foo directory. This resource permits just that.

Field Summary

Modifier and TypeField and Description
private final String[]
private final String

Constructor Summary

AccessConstructor and Description
pack-priv
JarDirectoryResource(String jarPath, boolean rootSlashPrefix, String path, String[] contents)

Method Summary

Modifier and TypeMethod and Description
public FileTime
public String
public boolean
public boolean
public boolean
public FileTime
public long
public FileTime
public long
public String[]
public Channel
openChannel(final int flags, int perm)

Implements org.jruby.util.FileResource.openChannel.

public InputStream
openInputStream()

Implements org.jruby.util.FileResource.openInputStream.

Opens a new input stream to read the contents of a resource and returns it.

public <T> T
unwrap(Class<T> type)

Implements org.jruby.util.FileResource.unwrap.

Unwrap the resource backend (replacement for hackyGetJRubyFile()).

Inherited from org.jruby.util.JarResource:
absolutePathcanExecutecanonicalPathcanReadcanWritecreateequalserrnoexistshashCodeisNullisSymLinklstatpathremoveJarResourcestattoString

Field Detail

contentsback to summary
private final String[] contents
pathback to summary
private final String path

Constructor Detail

JarDirectoryResourceback to summary
pack-priv JarDirectoryResource(String jarPath, boolean rootSlashPrefix, String path, String[] contents)

Method Detail

creationTimeback to summary
public FileTime creationTime()

Implements abstract org.jruby.util.JarResource.creationTime.

Implements org.jruby.util.DummyResourceStat.FileResourceExt.creationTime.

entryNameback to summary
public String entryName()

Implements abstract org.jruby.util.JarResource.entryName.

Annotations
@Override
isDirectoryback to summary
public boolean isDirectory()

Implements org.jruby.util.FileResource.isDirectory.

Annotations
@Override
isFileback to summary
public boolean isFile()

Implements org.jruby.util.FileResource.isFile.

Annotations
@Override
isRootback to summary
public boolean isRoot()
lastAccessTimeback to summary
public FileTime lastAccessTime()

Implements abstract org.jruby.util.JarResource.lastAccessTime.

Implements org.jruby.util.DummyResourceStat.FileResourceExt.lastAccessTime.

lastModifiedback to summary
public long lastModified()

Overrides org.jruby.util.JarResource.lastModified.

Implements org.jruby.util.FileResource.lastModified.

Annotations
@Override
lastModifiedTimeback to summary
public FileTime lastModifiedTime()

Implements abstract org.jruby.util.JarResource.lastModifiedTime.

Implements org.jruby.util.DummyResourceStat.FileResourceExt.lastModifiedTime.

lengthback to summary
public long length()

Implements org.jruby.util.FileResource.length.

Annotations
@Override
listback to summary
public String[] list()

Implements org.jruby.util.FileResource.list.

Annotations
@Override
openChannelback to summary
public Channel openChannel(final int flags, int perm) throws ResourceException

Implements org.jruby.util.FileResource.openChannel.

Annotations
@Override
openInputStreamback to summary
public InputStream openInputStream() throws IOException

Implements org.jruby.util.FileResource.openInputStream.

Doc from org.jruby.util.FileResource.openInputStream.

Opens a new input stream to read the contents of a resource and returns it. Note that implementations may be allocating native memory for the stream, so callers need to close this when they are done with it. users of this method should follow the pattern: close the stream where you open it.

Returns:InputStream

InputStream

Annotations
@Override
unwrapback to summary
public <T> T unwrap(Class<T> type)

Implements org.jruby.util.FileResource.unwrap.

Doc from org.jruby.util.FileResource.unwrap.

Unwrap the resource backend (replacement for hackyGetJRubyFile()).

Returns:T

backend if supported

Annotations
@Override