Class IOUtil
java.lang.Object
org.jenkinsci.test.acceptance.utils.IOUtil
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic FilefirstExisting(boolean directory, String... candidatePaths) Get First existing file or directory.static booleanisTcpPortFree(int port) static Stringstatic HttpURLConnectionopenConnection(URL url) Open URL connection with sanity timeout.static intGives random available TCP port.static intrandomTcpPort(int from, int to) Gives random available TCP port in the given range.
- 
Constructor Details- 
IOUtilpublic IOUtil()
 
- 
- 
Method Details- 
firstExisting@NonNull public static File firstExisting(boolean directory, String... candidatePaths) throws IOException Get First existing file or directory.- Parameters:
- directory- true if looking for file.
- Returns:
- File representing the file or directory.
- Throws:
- IOException- If nothing found.
 
- 
openConnectionOpen URL connection with sanity timeout.- Throws:
- IOException
 
- 
multiline
- 
randomTcpPortpublic static int randomTcpPort(int from, int to) Gives random available TCP port in the given range.- Parameters:
- from- if- <=0then default value 49152 is used
- to- if- <=0then default value 65535 is used
 
- 
randomTcpPortpublic static int randomTcpPort()Gives random available TCP port.
- 
isTcpPortFreepublic static boolean isTcpPortFree(int port) 
 
-