The getResources method can be used to find all matches in the class
path for a given path, e.g. to seek out all the META-INF/MANIFEST.MF
files contained in all of the .jar files in the class path.
We just taught the findResources() method to return all matches (rather
than only the first), so let's use that method to get all the matches
from the current class loader's class path elements.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
The findResources method is supposed to enumerate all the class path
elements' matching paths' URLs, but we used to stop at the first one.
While this is good enough when the system class path contains only a
single .jar file, since b88438d2(sketch of JAR support in Finder)
supports more than a single .jar file in the class path.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
When the system class path contains more than one .jar, it is quite
concievable that, say, 'META-INF/MANIFEST.MF' can be found in multiple
class path elements.
This commit teaches the working horse of class path inspection, the
Finder class, how to continue the search at a given state.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This is a very dumb implementation that wastes space and time by
constructing a full-blown ArrayList as backend. However, it is
better to have a dumb implementation than none at all, and we can
always do something about the performance when, and if, that should
become necessary.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
When creating an object array with more than two dimensions, the
component type was erroneously set to the base type, not the array
type of one less dimension.
This prevented Collection<Class[]>#toArray(Class[][]) from working
properly.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
We do not really support regular expressions yet, but we do support
trivial patterns including ones with escaped characters. Let's make sure
that that works as advertised.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
In the previous commit, we did not support characters in regular
expressions specified via \0..., \x... or \u... yet. This is a bit more
involved, therefore support for them is added in its own commit.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
When a regular expression contains escaped characters such as the
backslash, it is actually still a literal string. So let's support the
trivially-escaped characters, too, that are documented in
http://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This implementation is by no means intended to be complete, just enough to
support running http://http://loci.wisc.edu/software/bio-formats's
loci.formats.tools.ImageConverter tool.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Avian's ByteBuffer implementation is actually fixed to big endian. So
let's throw an exception if the user tries to change that.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
So far, we only allowed opening in read-only mode. Now, we also support
read/write mode in addition.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This implements all the methods required by the DataOutput interface; to
run Bio-Formats' bfconvert tool, actually only the write() and writeByte()
methods would be required.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
In particular when constructing regular expressions before compiling them,
it is a good idea to state which exact expression is non-trivial when
complaining about it.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
There was already non-Windows support, but it was put into the
Windows-specific part. Move it outside.
While at it, change the left-over 'st' to 'fileStat' to fix the
compilation.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>