<commit_before>JFreeSane: A SANE client for Java
=================================
[![Build Status](https://travis-ci.org/sjamesr/jfreesane.svg?branch=master)](https://travis-ci.org/sjamesr/jfreesane)
[![Coverage Status](https://coveralls.io/repos/github/sjamesr/jfreesane/badge.svg?branch=master)](https://coveralls.io/github/sjamesr/jfreesane?branch=master)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.googlecode.jfreesane/jfreesane/badge.svg?style=plastic)](https://maven-badges.herokuapp.com/maven-central/com.googlecode.jfreesane/jfreesane)
[![Gitter](https://badges.gitter.im/sjamesr/jfreesane.svg)](https://gitter.im/sjamesr/jfreesane)

JFreeSane is a pure-Java implementation of a SANE client. See [the SANE project
page](http://www.sane-project.org/) for more information about SANE itself.

- [Introduction](#introduction)
- [Getting JFreeSane](#getting-jfreesane)
- [Limitations](#limitations)
- [Please contribute](#please-contribute)
- [Usage](#usage)
    - [Connecting to SANE](#connecting-to-sane)
    - [Obtaining a device handle](#obtaining-a-device-handle)
    - [Listing known devices](#listing-known-devices)
    - [Opening the device](#opening-the-device)
    - [Acquiring an image](#acquiring-an-image)
    - [Device options](#device-options)
        - [Setting options](#setting-options)
        - [Reading options](#reading-options)
        - [Option getters and setters](#option-getters-and-setters)
    - [Reading from an automatic document feeder](#reading-from-an-automatic-document-feeder)
    - [Authentication](#authentication)
    - [Listening to events](#listening-to-events)

# Introduction

The purpose of this library is to provide a client to the Scanner Access Now Easy (SANE) daemon.
This allows Java programmers to obtain images from SANE image sources over a network.

For example, you can do the following:

```java
SaneSession session = SaneSession.withRemoteSane(
    InetAddress.getByName("my-sane-server.intranet"));
List<SaneDevice> devices = session.listDevices();
SaneDevice device = ...;  // determine which device you want to use
device.open();

BufferedImage image = device.acquireImage();  // scan an image
```

# Getting JFreeSane

The easiest way to get this software is using [Maven](http://maven.apache.org/). Put the following in your `pom.xml`:

```xml
<project>
  ...
  <dependencies>
     ...
     <dependency>
       <groupId>com.googlecode.jfreesane</groupId>
       <artifactId>jfreesane</artifactId>
       <version>0.98</version>
     </dependency>
   </dependencies>
</project>
```

Otherwise, you can [download the jar file](https://github.com/sjamesr/jfreesane/releases/tag/jfreesane-0.98)
and put it in your project's CLASSPATH.
JFreeSane also depends on [Google Guava](http://code.google.com/p/guava-libraries/), an
excellent collection of Java libraries that you should be using in your project anyway.
You will need to download the Guava JAR file and put that in your classpath as well.

Once JFreeSane is available on your classpath, please read on for a tutorial on how to use it.

Also consider joining the
[jfreesane-discuss](http://groups.google.com/group/jfreesane-discuss) mailing list.
It is a low-volume list where people can discuss JFreeSane, release announcements are
made and issues are reported.

# Limitations

* JFreeSane must be used with a running SANE daemon. It will not run SANE for you.
It cannot talk to your scanners without a SANE daemon.

# Please contribute

If you've been looking for a Java SANE client and you're familiar with SANE, please
consider contributing documentation or patches.<commit_msg>remove Guava from README.md<commit_after>JFreeSane: A SANE client for Java
=================================
[![Build Status](https://travis-ci.org/sjamesr/jfreesane.svg?branch=master)](https://travis-ci.org/sjamesr/jfreesane)
[![Coverage Status](https://coveralls.io/repos/github/sjamesr/jfreesane/badge.svg?branch=master)](https://coveralls.io/github/sjamesr/jfreesane?branch=master)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.googlecode.jfreesane/jfreesane/badge.svg?style=plastic)](https://maven-badges.herokuapp.com/maven-central/com.googlecode.jfreesane/jfreesane)
[![Gitter](https://badges.gitter.im/sjamesr/jfreesane.svg)](https://gitter.im/sjamesr/jfreesane)

JFreeSane is a pure-Java implementation of a SANE client. See [the SANE project
page](http://www.sane-project.org/) for more information about SANE itself.

- [Introduction](#introduction)
- [Getting JFreeSane](#getting-jfreesane)
- [Limitations](#limitations)
- [Please contribute](#please-contribute)
- [Usage](#usage)
    - [Connecting to SANE](#connecting-to-sane)
    - [Obtaining a device handle](#obtaining-a-device-handle)
    - [Listing known devices](#listing-known-devices)
    - [Opening the device](#opening-the-device)
    - [Acquiring an image](#acquiring-an-image)
    - [Device options](#device-options)
        - [Setting options](#setting-options)
        - [Reading options](#reading-options)
        - [Option getters and setters](#option-getters-and-setters)
    - [Reading from an automatic document feeder](#reading-from-an-automatic-document-feeder)
    - [Authentication](#authentication)
    - [Listening to events](#listening-to-events)

# Introduction

The purpose of this library is to provide a client to the Scanner Access Now Easy (SANE) daemon.
This allows Java programmers to obtain images from SANE image sources over a network.

For example, you can do the following:

```java
SaneSession session = SaneSession.withRemoteSane(
    InetAddress.getByName("my-sane-server.intranet"));
List<SaneDevice> devices = session.listDevices();
SaneDevice device = ...;  // determine which device you want to use
device.open();

BufferedImage image = device.acquireImage();  // scan an image
```

# Getting JFreeSane

The easiest way to get this software is using [Maven](http://maven.apache.org/). Put the following in your `pom.xml`:

```xml
<project>
  ...
  <dependencies>
     ...
     <dependency>
       <groupId>com.googlecode.jfreesane</groupId>
       <artifactId>jfreesane</artifactId>
       <version>0.98</version>
     </dependency>
   </dependencies>
</project>
```

Otherwise, you can [download the jar file](https://github.com/sjamesr/jfreesane/releases/tag/jfreesane-0.98)
and put it in your project's CLASSPATH.

Once JFreeSane is available on your classpath, please read on for a tutorial on how to use it.

Also consider joining the
[jfreesane-discuss](http://groups.google.com/group/jfreesane-discuss) mailing list.
It is a low-volume list where people can discuss JFreeSane, release announcements are
made and issues are reported.

# Limitations

* JFreeSane must be used with a running SANE daemon. It will not run SANE for you.
It cannot talk to your scanners without a SANE daemon.

# Please contribute

If you've been looking for a Java SANE client and you're familiar with SANE, please
consider contributing documentation or patches.
{'fraction_non_alphanumeric': 0.1319355298816146, 'fraction_numerical': 0.0017115960633290544, 'mean_word_length': 4.465315666406859, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 29, 'https://': 18, 'lorem ipsum': 0, 'www.': 2, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2157065', 'n_tokens_mistral': 2338, 'n_tokens_neox': 2166, 'n_words': 590}