org.apache.hadoop.fs
Class PathIOException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.io.IOException
              extended by org.apache.hadoop.fs.PathIOException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
PathAccessDeniedException, PathExistsException, PathNotFoundException, PathPermissionException

public class PathIOException
extends IOException

Exceptions based on standard posix/linux style exceptions for path related errors. Returns an exception with the format "path: standard error string". This exception corresponds to Error Input/ouput(EIO)

See Also:
Serialized Form

Constructor Summary
  PathIOException(String path)
          Constructor a generic I/O error exception
  PathIOException(String path, String error)
          Avoid using this method.
protected PathIOException(String path, String error, Throwable cause)
           
  PathIOException(String path, Throwable cause)
          Appends the text of a Throwable to the default error message
 
Method Summary
 String getMessage()
          Format: cmd: {operation} `path' {to `target'}: error string
 Path getPath()
           
 Path getTargetPath()
           
 void setOperation(String operation)
          Optional operation that will preface the path
 void setTargetPath(String targetPath)
          Optional path if the exception involved two paths, ex.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PathIOException

public PathIOException(String path)
Constructor a generic I/O error exception

Parameters:
path - for the exception

PathIOException

public PathIOException(String path,
                       Throwable cause)
Appends the text of a Throwable to the default error message

Parameters:
path - for the exception
cause - a throwable to extract the error message

PathIOException

public PathIOException(String path,
                       String error)
Avoid using this method. Use a subclass of PathIOException if possible.

Parameters:
path - for the exception
error - custom string to use an the error text

PathIOException

protected PathIOException(String path,
                          String error,
                          Throwable cause)
Method Detail

getMessage

public String getMessage()
Format: cmd: {operation} `path' {to `target'}: error string

Overrides:
getMessage in class Throwable

getPath

public Path getPath()
Returns:
Path that generated the exception

getTargetPath

public Path getTargetPath()
Returns:
Path if the operation involved copying or moving, else null

setOperation

public void setOperation(String operation)
Optional operation that will preface the path

Parameters:
operation - a string

setTargetPath

public void setTargetPath(String targetPath)
Optional path if the exception involved two paths, ex. a copy operation

Parameters:
targetPath - the of the operation


Copyright © 2013 Apache Software Foundation. All Rights Reserved.