def get_input_stream(&aProc)
if @ftype == :directory
return yield(NullInputStream.instance) if block_given?
return NullInputStream.instance
elsif @filepath
case @ftype
when :file
return File.open(@filepath, "rb", &aProc)
when :symlink
linkpath = File::readlink(@filepath)
stringio = StringIO.new(linkpath)
return yield(stringio) if block_given?
return stringio
else
raise "unknown @ftype #{@ftype}"
end
else
zis = ZipInputStream.new(@zipfile, localHeaderOffset)
zis.get_next_entry
if block_given?
begin
return yield(zis)
ensure
zis.close
end
else
return zis
end
end
end