object URLUtil
URL-related utility methods.
- Alphabetic
- By Inheritance
- URLUtil
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
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
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
def
download(url: URL, pathOut: File)(implicit ctx: ExecutionContext): Future[File]
Download the specified URL to a file.
Download the specified URL to a file.
- url
The URL
- pathOut
File to receive the output. If the file exists, it is overwritten. If the file does not exist, it is created. If any of the directories in the path do not exist, they are created.
- ctx
The concurrent execution content to use
- returns
A
Future
of the path.
-
def
download(url: String, pathOut: File)(implicit ctx: ExecutionContext): Future[String]
Download the specified URL to a file.
Download the specified URL to a file.
- url
The string containing the URI/URL
- pathOut
File to receive the output. If the file exists, it is overwritten. If the file does not exist, it is created. If any of the directories in the path do not exist, they are created.
- ctx
The concurrent execution content to use
- returns
a
Future
of the path
-
def
download(url: URL, pathOut: String)(implicit ctx: ExecutionContext): Future[String]
Download the specified URL to a file.
Download the specified URL to a file.
- url
The
grizzled.net.URL
- pathOut
Path of file to receive the output. If the file exists, it is overwritten. If the file does not exist, it is created. If any of the directories in the path do not exist, they are created.
- ctx
The concurrent execution content to use
- returns
a
Future
of the path
-
def
download(url: java.net.URL, pathOut: String)(implicit ctx: ExecutionContext): Future[String]
Download the specified URL to a file.
Download the specified URL to a file.
- url
The
java.net.URL
- pathOut
Path of file to receive the output. If the file exists, it is overwritten. If the file does not exist, it is created. If any of the directories in the path do not exist, they are created.
- ctx
The concurrent execution content to use
- returns
a
Future
of the path
-
def
download(url: String, pathOut: String)(implicit ctx: ExecutionContext): Future[String]
Download the specified URL to a file.
Download the specified URL to a file.
- url
The string containing the URI/URL
- pathOut
Path of file to receive the output. If the file exists, it is overwritten. If the file does not exist, it is created. If any of the directories in the path do not exist, they are created.
- ctx
The concurrent execution content to use
- returns
a
Future
of the path
-
def
download(url: URL)(implicit ctx: ExecutionContext): Future[File]
Download the specified URL to a file.
Download the specified URL to a file. The name of the file is a generated temporary file name. If you want to control the file name, use one of the other versions of this function.
- url
The
grizzled.net.URL
- ctx
The concurrent execution content to use
- returns
a
Future
of the file to which the download was written
-
def
download(url: java.net.URL)(implicit ctx: ExecutionContext): Future[File]
Download the specified URL to a file.
Download the specified URL to a file. The name of the file is a generated temporary file name. If you want to control the file name, use one of the other versions of this function.
- url
The
java.net.URL
- ctx
The concurrent execution content to use
- returns
a
Future
of the file to which the download was written
-
def
download(url: String)(implicit ctx: ExecutionContext): Future[File]
Download the specified URL to a file.
Download the specified URL to a file. The name of the file is a generated temporary file name. If you want to control the file name, use one of the other versions of this function.
- url
The string containing the URI/URL
- ctx
The concurrent execution content to use
- returns
a
Future
of the file to which the download was written
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
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()
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
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( ... )
-
def
withDownloadedFile[T](url: URL, timeout: Duration)(block: (File) ⇒ T)(implicit ctx: ExecutionContext): Try[T]
Execute a block of code with a downloaded, temporary file.
Execute a block of code with a downloaded, temporary file. The specified URL is downloaded to a file, the file is passed to the block, and when the block exits, the file is removed.
Note: This function is synchronous, waiting for the underlying
Future
objects using a timeout specified by the caller. For asynchronous operations, usedownload()
.- url
the URL
- timeout
the timeout, as a duration.
- block
the block to execute
- ctx
The concurrent execution content to use
- returns
Failure(error)
on error.Success(t)
, wheret
is what the block returns, on success.
-
def
withDownloadedFile[T](url: java.net.URL, timeout: Duration)(block: (File) ⇒ T)(implicit ctx: ExecutionContext): Try[T]
Execute a block of code with a downloaded, temporary file.
Execute a block of code with a downloaded, temporary file. The specified URL is downloaded to a file, the file is passed to the block, and when the block exits, the file is removed.
Note: This function is synchronous, waiting for the underlying
Future
objects using a timeout specified by the caller. For asynchronous operations, usedownload()
.- url
the
java.net.URL
- timeout
the timeout, as a duration.
- block
the block to execute
- ctx
The concurrent execution content to use
- returns
Failure(error)
on error.Success(t)
, wheret
is what the block returns, on success.
-
def
withDownloadedFile[T](url: String, timeout: Duration)(block: (File) ⇒ T)(implicit ctx: ExecutionContext): Try[T]
Execute a block of code with a downloaded, temporary file.
Execute a block of code with a downloaded, temporary file. The specified URL is downloaded to a file, the file is passed to the block, and when the block exits, the file is removed.
Note: This function is synchronous, waiting for the underlying
Future
objects using a timeout specified by the caller. For asynchronous operations, usedownload()
.- url
the URL
- timeout
the timeout, as a duration.
- block
the block to execute
- ctx
The concurrent execution content to use
- returns
Failure(error)
on error.Success(t)
, wheret
is what the block returns, on success.