Package me.desair.tus.server.util
Class Utils
java.lang.Object
me.desair.tus.server.util.Utils
Utility class that contains various static helper methods
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
buildRemoteIpList
(jakarta.servlet.http.HttpServletRequest servletRequest) Build a comma-separated list based on the remote address of the request and the X-Forwareded-For header.static String
static Long
getLongHeader
(jakarta.servlet.http.HttpServletRequest request, String header) static FileLock
lockFileExclusively
(FileChannel channel) static FileLock
lockFileShared
(FileChannel channel) parseConcatenationIDsFromHeader
(String uploadConcatValue) static <T> T
readSerializable
(Path path, Class<T> clazz) static void
sleep
(long sleepTimeMillis) Sleep the specified number of millisecondsstatic void
writeSerializable
(Serializable object, Path path)
-
Method Details
-
getHeader
-
getLongHeader
-
buildRemoteIpList
Build a comma-separated list based on the remote address of the request and the X-Forwareded-For header. The list is constructed as "client, proxy1, proxy2".- Returns:
- A comma-separated list of ip-addresses
-
parseConcatenationIDsFromHeader
-
readSerializable
- Throws:
IOException
-
writeSerializable
- Throws:
IOException
-
lockFileExclusively
- Throws:
IOException
-
sleep
public static void sleep(long sleepTimeMillis) Sleep the specified number of milliseconds- Parameters:
sleepTimeMillis
- The time to sleep in milliseconds
-