Git Product home page Git Product logo

raroscope's Introduction

Introduction

Download Maven Central CircleCI

Ever faced the challenge to be able to scan RAR archives using Java? Wished the API was as simple and easy to use as the ones provided for ZIP and JAR handling in Java? Don't want the hassles of including expensive native code into your Java application?

RARoScope is here to solve all these woes. The following lines are all you've to write to list out all the entries of a RAR file, say, D:/Data.rar.

// Construct the RARFile object using the file path
RARFile file = new RARFile("D:/Data.rar");

// Get the handle to the Enumeration
Enumeration<RAREntry> entries = file.entries();

// Iterate and print
while (entries.hasMoreElements()) {
    RAREntry entry = entries.nextElement();
    
    System.out.println(entry.getName());
}

Impressed? I sure was thrilled when I first wrote the library! Go ahead, download RARoScope and start using it in your applications right now.

Usage

Gradle

compile 'com.adarshr:raroscope:1.0.2'

Maven

<dependency>
    <groupId>com.adarshr</groupId>
    <artifactId>raroscope</artifactId>
    <version>1.0.2</version>
</dependency>

What RARoScope can do

Exposing a simple API, RARoScope packs the following rich features.

Enhanced checking for true RAR archives

RARoScope ensures false RAR archives such as files with just a ".rar" extension do not interrupt further processing by reading and verifying the RAR marker header block and throwing exceptions where appropriate.

A rich RAREntry class

RARoScope reads almost all the information available in a RAR archive and loads them into the RAREntry instances. Following are the file metadata retrieved.

  • Full file name including the path
  • Date and Time the file was modified/created
  • Compressed file size
  • Uncompressed file size
  • The CRC checksum for the file
  • Whether a file is a directory
  • The operating system on which the file was added to the archive
  • The compression method used
  • The RAR version required to decompress and retrieve the file

Optimized for performance

RARoScope has been designed to make efficient use of the underlying byte buffer so that very few I/O reads happen in each cycle. An effect of this is improved performance with very small cycle iteration times.

What RARoScope can't do

However, because of various factors, RARoScope does have its limitations and can't do the following.

Creating RAR archives

Because of the proprietary nature of the RAR archive format, RARoScope can't be used to create RAR archives.

Reading file contents/decompressing

Since RARoScope has been poised as more of a "RAR scanning library" rather than a "RAR decompressor" for Java, it can't do the decompressing part. However, this is open to change in the near future. Depending on the response I get, I might implement a decompressing logic.

Reading RAR entries with comments

RARoScope doesn't support reading comments and entries with comments as of now.

Multi-volume RAR archives

RARoScope doesn't support reading multi-volume archives yet.

raroscope's People

Contributors

radarsh avatar leorchn avatar nemoo2580 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.