Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

42 lines (33 sloc) 0.949 kB
/* sbt -- Simple Build Tool
* Copyright 2011 Sanjin Sehic
*/
package sbt
import java.net.URI
class RichURI(uri: URI)
{
def copy(scheme: String = uri.getScheme, userInfo: String = uri.getUserInfo,
host: String = uri.getHost, port: Int = uri.getPort, path: String = uri.getPath,
query: String = uri.getQuery, fragment: String = uri.getFragment) =
new URI(scheme, userInfo, host, port, path, query, fragment)
def hasFragment = uri.getFragment ne null
def withoutFragment =
if (hasFragment)
new URI(uri.getScheme, uri.getSchemeSpecificPart, null)
else
uri
def hasMarkerScheme = new URI(uri.getRawSchemeSpecificPart).getScheme ne null
def withoutMarkerScheme =
{
if (hasMarkerScheme)
if (hasFragment)
new URI(uri.getRawSchemeSpecificPart + "#" + uri.getRawFragment)
else
new URI(uri.getRawSchemeSpecificPart)
else
uri
}
}
object RichURI
{
implicit def fromURI(uri: URI) = new RichURI(uri)
}
Jump to Line
Something went wrong with that request. Please try again.