On Thu, Jul 14, 2011 at 12:36 PM, Alessandro Adamou <[email protected]> wrote:
> It would be great to have another IRIMapper implementation that recurses
> into archive contents instead. It would be nice to obtain an InpuStream for
> each ArchiveEntry without copying its content, can you do something like
> that with commons-compressors? (perhaps the question is silly?)
>
Basically it is very easy:
ArchiveInputStream ais; //parsed
ArchiveEntry entry;
while ((entry = ais.getNextEntry()) != null) {
if (!entry.isDirectory()) {
//check if entry is an Ontology
//if an Ontology parse the ArchiveInputStream
//as normal InputStream
}
}
In case the method you need to parse the Inputstream closes the stream
(something we would not like to happen, because we need to read more
files form the Archive) than you will need a simple helper class that
wraps the ArchiveInputStream and ignores calls to close.
static class UncloseableInputStream extends FilterInputStream {
UncloseableInputStream(InputStream is) {
super(is);
}
public void close() {
// do nothing
}
}
This should do the trick.
>> I have never tried this with additional spaces and line breaks. Maybe try
>>
>> <Data-Files>schemas,schemas/registry</Data-Files>
>>
>> But because most users will write it like this I will definitely test
>> this and if currently not working add support for this.
>
> Indeed, it's not trimming spaces and breaks. The way you suggested it works
> for me too. Thanks!
>
nice. I will definitely add support for trimming spaces and line breaks.
>>> The MainDataFileProvider will always throw IO Exceptions if a resource
>>> is not found.
>
> I imagined that. The problem was that the resource was supposed to be
> found...
>
> Alessandro
>
>
> --
> M.Sc. Alessandro Adamou
>
> Alma Mater Studiorum - Università di Bologna
> Department of Computer Science
> Mura Anteo Zamboni 7, Bologna - Italy
>
> Semantic Technology Laboratory (STLab)
> Institute for Cognitive Science and Technology (ISTC)
> National Research Council (CNR)
> Via Nomentana 56, 00161 Rome - Italy
>
>
> "As for the charges against me, I am unconcerned. I am beyond their timid,
> lying morality, and so I am beyond caring."
> (Col. Walter E. Kurtz)
>
>
--
| Rupert Westenthaler [email protected]
| Bodenlehenstraße 11 ++43-699-11108907
| A-5500 Bischofshofen