public class TimeoutRequest<E>
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.util.concurrent.Callable<E> |
call |
static boolean |
enable |
Constructor and Description |
---|
TimeoutRequest(java.util.concurrent.Callable<E> call)
initialize the TimeoutRequest with a callable method
|
Modifier and Type | Method and Description |
---|---|
E |
call(long timeout)
call the method using a time-out
|
static boolean |
canRead(SmbFile file,
long timeout)
check if a smb file can be read
|
static boolean |
canWrite(SmbFile file,
long timeout)
check if a smb file ran be written
|
static boolean |
exists(SmbFile file,
long timeout)
check if a smb file exists
|
static java.lang.String |
getHostName(java.net.InetAddress i,
long timeout)
perform a reverse domain name lookup for a given InetAddress within a given timeout
|
static boolean |
isDirectory(SmbFile file,
long timeout)
check if a smb file is a directory
|
static boolean |
isHidden(SmbFile file,
long timeout)
check if a smb file is hidden
|
static long |
lastModified(SmbFile file,
long timeout)
get last-modified time of a smb file
|
static long |
length(SmbFile file,
long timeout)
get the size of a smb file
|
static java.lang.String[] |
list(SmbFile file,
long timeout)
get list of a smb directory
|
static boolean |
ping(java.lang.String host,
int port,
int timeout)
ping a remote server using a given uri and a time-out
|
public static boolean enable
private final java.util.concurrent.Callable<E> call
public TimeoutRequest(java.util.concurrent.Callable<E> call)
public E call(long timeout) throws java.util.concurrent.ExecutionException
timeout
- java.util.concurrent.ExecutionException
public static boolean ping(java.lang.String host, int port, int timeout)
uri
- timeout
- public static java.lang.String getHostName(java.net.InetAddress i, long timeout) throws java.util.concurrent.ExecutionException
i
- timeout
- java.util.concurrent.ExecutionException
public static boolean exists(SmbFile file, long timeout) throws java.io.IOException
file
- timeout
- java.io.IOException
public static boolean canRead(SmbFile file, long timeout) throws java.io.IOException
file
- timeout
- java.io.IOException
public static boolean canWrite(SmbFile file, long timeout) throws java.io.IOException
file
- timeout
- java.io.IOException
public static boolean isHidden(SmbFile file, long timeout) throws java.io.IOException
file
- timeout
- java.io.IOException
public static boolean isDirectory(SmbFile file, long timeout) throws java.io.IOException
file
- timeout
- java.io.IOException
public static long length(SmbFile file, long timeout) throws java.io.IOException
file
- timeout
- java.io.IOException
public static long lastModified(SmbFile file, long timeout) throws java.io.IOException
file
- timeout
- java.io.IOException
public static java.lang.String[] list(SmbFile file, long timeout) throws java.io.IOException
file
- timeout
- java.io.IOException