Package org.apache.spark.paths
Class SparkPath
Object
org.apache.spark.paths.SparkPath
- All Implemented Interfaces:
- Serializable,- scala.Equals,- scala.Product
A canonical representation of a file path. This class is intended to provide
 type-safety to the way that Spark handles Paths. Paths can be represented as
 Strings in multiple ways, which are not always compatible. Spark regularly uses
 two ways: 1. hadoop Path.toString and java URI.toString.
- See Also:
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic SparkPathfromFileStatus(org.apache.hadoop.fs.FileStatus fs) static SparkPathfromPath(org.apache.hadoop.fs.Path path) static SparkPathfromPathString(String str) Creates a SparkPath from a hadoop Path string.static SparkPathstatic SparkPathfromUrlString(String str) Creates a SparkPath from a url-encoded string.org.apache.hadoop.fs.PathtoPath()toString()toUri()Methods inherited from class java.lang.Objectequals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface scala.EqualscanEqual, equalsMethods inherited from interface scala.ProductproductArity, productElement, productElementName, productElementNames, productIterator, productPrefix
- 
Constructor Details- 
SparkPathpublic SparkPath()
 
- 
- 
Method Details- 
fromPathStringCreates a SparkPath from a hadoop Path string. Please be very sure that the provided string is encoded (or not encoded) in the right way.Please see the hadoop Path documentation here: https://hadoop.apache.org/docs/stable/api/org/apache/hadoop/fs/Path.html#Path-java.lang.String- - Parameters:
- str- (undocumented)
- Returns:
- (undocumented)
 
- 
fromPath
- 
fromFileStatus
- 
fromUrlStringCreates a SparkPath from a url-encoded string. Note: It is the responsibility of the caller to ensure that str is a valid url-encoded string.- Parameters:
- str- (undocumented)
- Returns:
- (undocumented)
 
- 
fromUri
- 
urlEncoded
- 
toUri
- 
toPathpublic org.apache.hadoop.fs.Path toPath()
- 
toString
 
-