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 StringbuildRemoteIpList(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 Stringstatic LonggetLongHeader(jakarta.servlet.http.HttpServletRequest request, String header) static FileLocklockFileExclusively(FileChannel channel) static FileLocklockFileShared(FileChannel channel) parseConcatenationIDsFromHeader(String uploadConcatValue) static <T> TreadSerializable(Path path, Class<T> clazz) static voidsleep(long sleepTimeMillis) Sleep the specified number of millisecondsstatic voidwriteSerializable(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
-