Package org.apache.sling.feature.io.artifacts

# Class ArtifactHandler

java.lang.Object
org.apache.sling.feature.io.artifacts.ArtifactHandler

public class ArtifactHandler extends Object
A handler provides a file object for an artifact.

## Constructor Summary

Constructors
Constructor
Description
`ArtifactHandler(File file)`
Create a new handler.
`ArtifactHandler(String url, URL localURL)`
Create a new handler.
`ArtifactHandler(Path file)`
Create a new handler.

## Method Summary

Modifier and Type
Method
Description
`URL`
`getLocalURL()`
Get a local url for the artifact
`String`
`getUrl()`
Get the url of the artifact

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

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

## Constructor Details

### ArtifactHandler

public ArtifactHandler(String url, URL localURL)
Create a new handler.

Parameters:
  `url` - The url of the artifact
  `localURL` - The local URL for the artifact

### ArtifactHandler

public ArtifactHandler(File file) throws MalformedURLException
Create a new handler.

Parameters:
  `file` - The file for the artifact
Throws:
  `MalformedURLException` - If the file name cannot be converted to a URL.
Since:
  1.1.0

### ArtifactHandler

public ArtifactHandler(Path file) throws MalformedURLException
Create a new handler.

Parameters:
  `file` - The file for the artifact
Throws:
  `MalformedURLException` - If the file name cannot be converted to a URL.
Since:
  1.2.0

## Method Details

### getUrl

public String getUrl()
Get the url of the artifact

Returns:
  The url.

### getLocalURL

public URL getLocalURL()
Get a local url for the artifact

Returns:
  The file