Package com.norconex.commons.lang

# Class OsResource<T>

java.lang.Object
com.norconex.commons.lang.OsResource<T>

Type Parameters:
  `T` - resource type

public class OsResource<T> extends Object

Provides an abstraction over operating-system specific resources (e.g. paths). Simply a convenience class saving you from checking for the OS yourself to figure out which resource to use, for major OSes.

A different resource can be specified for all OSes but only one will actually get set, based on the currently detected OS. OSes are mutually exclusive. For instance, Unix does not include Linux or Mac operating systems.

Since:
  2.0.0

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `OsResource()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `T`
  `get()`
  `OsResource<T>`
  `linux(T resource)`
  `OsResource<T>`
  `mac(T resource)`
  `OsResource<T>`
  `unix(T resource)`
  `OsResource<T>`
  `win(T resource)`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### OsResource

    public OsResource()

- ## Method Details

  - ### win

    public OsResource<T> win(T resource)

  - ### unix

    public OsResource<T> unix(T resource)

  - ### linux

    public OsResource<T> linux(T resource)

  - ### mac

    public OsResource<T> mac(T resource)

  - ### get

    public T get()