final case class URL(protocol: String, host: Option[String], port: Option[Int], path: Option[String], query: Option[String] = None, userInfo: Option[String] = None, fragment: Option[String] = None) extends Product with Serializable
Convenient Scala case-class wrapper for a java.net.URL
. This class
doesn't include all the capabilities. For example, it lacks the equivalent
of getContent()
, as that's better handled through other means.
- protocol
the protocol, if defined
- host
the host, if defined
- port
the port, if defined
- path
the path
- query
the query string, if any
- userInfo
the URL's user info, if any
- fragment
the fragment, if any
- Annotations
- @SuppressWarnings()
- Alphabetic
- By Inheritance
- URL
- Serializable
- Serializable
- Product
- Equals
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
-
new
URL(protocol: String, host: Option[String], port: Option[Int], path: Option[String], query: Option[String] = None, userInfo: Option[String] = None, fragment: Option[String] = None)
- protocol
the protocol, if defined
- host
the host, if defined
- port
the port, if defined
- path
the path
- query
the query string, if any
- userInfo
the URL's user info, if any
- fragment
the fragment, if any
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
authority: Option[String]
The coded authority for this URI.
The coded authority for this URI.
- returns
the authority, if any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
val
defaultPort: Option[Int]
Get the default port for the protocol.
Get the default port for the protocol.
- returns
the default port, if defined
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
- val fragment: Option[String]
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- val host: Option[String]
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
val
javaURL: java.net.URL
The underlying
java.net.URL
. -
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
openStream(): Try[InputStream]
Open an input stream to the URL.
Open an input stream to the URL.
- returns
Success(stream)
orFailure(Exception)
- val path: Option[String]
- val port: Option[Int]
- val protocol: String
- val query: Option[String]
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toExternalForm: String
Get the URL string representation of this URL (i.e., the string you could paste into a browser).
Get the URL string representation of this URL (i.e., the string you could paste into a browser). Contrast this function with
toString()
, which gets the string representation of the object and its fields.- returns
the string
- val userInfo: Option[String]
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )