Cups
Keywords: org.cups.Cups,Cups class

Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.cups
Class Cups

    java.lang.Object
      |
      +--org.cups.Cups

public class Cups
extends java.lang.Object

Constructor Summary
`Cups()` Void constructor.
`Cups(java.net.URL p_url)` Constructor using a `URL`.

Method Summary
`int` | `cupsCancelJob(java.lang.String printer_name, int p_job_id, java.lang.String p_user_name)` Cancel a job - send a job cancel request to the server.
`java.lang.String` | `cupsGetDefault()` Get default destination.
`org.cups.CupsJob[]` | `cupsGetJobs(boolean showMyJobs, boolean showCompleted)` Get a list of jobs.
`java.util.List` | `cupsGetPrinterAttributes(java.lang.String printer_name)` Get printer attributes
`java.lang.String[]` | `cupsGetPrinters()` Get a list of printers.
`java.util.List` | `cupsGetPrinterStatus(java.lang.String printer_name)`
`org.cups.CupsJob` | `cupsPrintFile(java.lang.String p_filename, org.cups.IPPAttribute[] p_attrs)` Print a file.
`boolean` | `doRequest()` Do a CUPS request to the server.
`boolean` | `doRequest(java.io.File file)` Send a FILE to the CUPS server.
`boolean` | `doRequest(java.lang.String from)`
`boolean` | `getEncrypt()` Get the value of the `encrypt` member.
`void` | `setDest(java.lang.String p_dest)` Set the value of the `dest` member.
`void` | `setEncrypt(boolean p_encrypt)` Set the value of the `encrypt` member.
`void` | `setInstance(java.lang.String p_instance)` Set the value of the `instance` member.
`void` | `setPasswd(java.lang.String p_passwd)` Set the value of the `passwd` member.
`void` | `setPath(java.lang.String p_path)` Set the value of the `path` member.
`void` | `setPort(int p_port)` Set the value of the `port` member.
`void` | `setProtocol(java.lang.String p_protocol)` Set the value of the `protocol` member.
`void` | `setServer(java.lang.String p_server)` Set the value of the `server` member.
`void` | `setUser(java.lang.String p_user)` Set the value of the `user` member.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### Cups

    public Cups()

  Void constructor.

### Cups

    public Cups(java.net.URL p_url)

  Constructor using a `URL`.

Method Detail

### setProtocol

    public void setProtocol(java.lang.String p_protocol)

  Set the value of the `protocol` member. Valid values are ipp or http.

### setServer

    public void setServer(java.lang.String p_server)

  Set the value of the `server` member. This is an IP address or a hostname.

### setPort

    public void setPort(int p_port)

  Set the value of the `port` member.

### setUser

    public void setUser(java.lang.String p_user)

  Set the value of the `user` member.

### setPasswd

    public void setPasswd(java.lang.String p_passwd)

  Set the value of the `passwd` member.

### setDest

    public void setDest(java.lang.String p_dest)

  Set the value of the `dest` member.

### setInstance

    public void setInstance(java.lang.String p_instance)

  Set the value of the `instance` member.

### setEncrypt

    public void setEncrypt(boolean p_encrypt)

  Set the value of the `encrypt` member.

### getEncrypt

    public boolean getEncrypt()

  Get the value of the `encrypt` member.

  Returns:
    `boolean` Encryption on or off.

### setPath

    public void setPath(java.lang.String p_path)

  Set the value of the `path` member. This is the path that will be used in the POST method.

### doRequest

    public boolean doRequest(java.lang.String from)
                      throws java.io.IOException

    `java.io.IOException`

### doRequest

    public boolean doRequest()
                      throws java.io.IOException

  Do a CUPS request to the server.

  Returns:
    `boolean` True on success, false otherwise
    `java.io.IOException`

### doRequest

    public boolean doRequest(java.io.File file)
                      throws java.io.IOException

  Send a FILE to the CUPS server.

  Returns:
    `boolean` True on success, false otherwise
    `java.io.IOException`

### cupsGetJobs

    public org.cups.CupsJob[] cupsGetJobs(boolean showMyJobs,
                                          boolean showCompleted)
                                   throws java.io.IOException

  Get a list of jobs.

  Returns:
    `CupsJob[]` Array of job objects, or null.
    `java.io.IOException`

### cupsGetPrinters

    public java.lang.String[] cupsGetPrinters()
                                       throws java.io.IOException

  Get a list of printers.

  Returns:
    `String[]` Array of printers, or null.
    `java.io.IOException`

### cupsGetDefault

    public java.lang.String cupsGetDefault()
                                    throws java.io.IOException

  Get default destination.

  Returns:
    `String` Name of default printer, or null.
    `java.io.IOException`

### cupsGetPrinterAttributes

    public java.util.List cupsGetPrinterAttributes(java.lang.String printer_name)
                                            throws java.io.IOException

  Get printer attributes

  Returns:
    `List` List of attributes.
    `java.io.IOException`
  See Also:
    `CupsPrinter`

### cupsPrintFile

    public org.cups.CupsJob cupsPrintFile(java.lang.String p_filename,
                                          org.cups.IPPAttribute[] p_attrs)
                                   throws java.io.IOException

  Print a file.

  Returns:
    `CupsJob` Object with job info.
    `java.io.IOException`
  See Also:
    `CupsJob`

### cupsCancelJob

    public int cupsCancelJob(java.lang.String printer_name,
                             int p_job_id,
                             java.lang.String p_user_name)
                      throws java.io.IOException

  Cancel a job - send a job cancel request to the server.

    `java.io.IOException`

### cupsGetPrinterStatus

    public java.util.List cupsGetPrinterStatus(java.lang.String printer_name)
                                        throws java.io.IOException

    `java.io.IOException`

Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD