public class jdk.internal.net.http.ResponseBodyHandlers$FileDownloadBodyHandler implements java.net.http.HttpResponse$BodyHandler<java.nio.file.Path>
minor version: 0
major version: 59
flags: flags: (0x0021) ACC_PUBLIC, ACC_SUPER
this_class: jdk.internal.net.http.ResponseBodyHandlers$FileDownloadBodyHandler
super_class: java.lang.Object
{
private final java.nio.file.Path directory;
descriptor: Ljava/nio/file/Path;
flags: (0x0012) ACC_PRIVATE, ACC_FINAL
private final java.util.List<java.nio.file.OpenOption> openOptions;
descriptor: Ljava/util/List;
flags: (0x0012) ACC_PRIVATE, ACC_FINAL
Signature: Ljava/util/List<Ljava/nio/file/OpenOption;>;
private final java.io.FilePermission[] filePermissions;
descriptor: [Ljava/io/FilePermission;
flags: (0x0012) ACC_PRIVATE, ACC_FINAL
static final java.lang.String DISPOSITION_TYPE;
descriptor: Ljava/lang/String;
flags: (0x0018) ACC_STATIC, ACC_FINAL
ConstantValue: "attachment;"
static final java.util.regex.Pattern FILENAME;
descriptor: Ljava/util/regex/Pattern;
flags: (0x0018) ACC_STATIC, ACC_FINAL
static final java.util.List<java.lang.String> PROHIBITED;
descriptor: Ljava/util/List;
flags: (0x0018) ACC_STATIC, ACC_FINAL
Signature: Ljava/util/List<Ljava/lang/String;>;
static void <clinit>();
descriptor: ()V
flags: (0x0008) ACC_STATIC
Code:
stack=5, locals=0, args_size=0
0: ldc "filename\\s*="
iconst_2
invokestatic java.util.regex.Pattern.compile:(Ljava/lang/String;I)Ljava/util/regex/Pattern;
putstatic jdk.internal.net.http.ResponseBodyHandlers$FileDownloadBodyHandler.FILENAME:Ljava/util/regex/Pattern;
1: ldc "."
ldc ".."
ldc ""
ldc "~"
ldc "|"
invokestatic java.util.List.of:(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/util/List;
putstatic jdk.internal.net.http.ResponseBodyHandlers$FileDownloadBodyHandler.PROHIBITED:Ljava/util/List;
return
LocalVariableTable:
Start End Slot Name Signature
public static jdk.internal.net.http.ResponseBodyHandlers$FileDownloadBodyHandler create(java.nio.file.Path, java.util.List<java.nio.file.OpenOption>);
descriptor: (Ljava/nio/file/Path;Ljava/util/List;)Ljdk/internal/net/http/ResponseBodyHandlers$FileDownloadBodyHandler;
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=5, locals=9, args_size=2
start local 0 start local 1 0: aconst_null
astore 2
start local 2 1: invokestatic java.lang.System.getSecurityManager:()Ljava/lang/SecurityManager;
astore 3
start local 3 2: aload 3
ifnull 11
3: aload 0
invokestatic jdk.internal.net.http.ResponseBodyHandlers.pathForSecurityCheck:(Ljava/nio/file/Path;)Ljava/lang/String;
astore 4
start local 4 4: new java.io.FilePermission
dup
aload 4
ldc "write"
invokespecial java.io.FilePermission.<init>:(Ljava/lang/String;Ljava/lang/String;)V
astore 5
start local 5 5: new java.lang.StringBuilder
dup
aload 4
invokestatic java.lang.String.valueOf:(Ljava/lang/Object;)Ljava/lang/String;
invokespecial java.lang.StringBuilder.<init>:(Ljava/lang/String;)V
getstatic java.io.File.separatorChar:C
invokevirtual java.lang.StringBuilder.append:(C)Ljava/lang/StringBuilder;
ldc "*"
invokevirtual java.lang.StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
invokevirtual java.lang.StringBuilder.toString:()Ljava/lang/String;
astore 6
start local 6 6: new java.io.FilePermission
dup
aload 6
ldc "write"
invokespecial java.io.FilePermission.<init>:(Ljava/lang/String;Ljava/lang/String;)V
astore 7
start local 7 7: aload 3
aload 7
invokevirtual java.lang.SecurityManager.checkPermission:(Ljava/security/Permission;)V
8: new java.io.FilePermission
dup
aload 4
ldc "read"
invokespecial java.io.FilePermission.<init>:(Ljava/lang/String;Ljava/lang/String;)V
astore 8
start local 8 9: aload 3
aload 8
invokevirtual java.lang.SecurityManager.checkPermission:(Ljava/security/Permission;)V
10: iconst_2
anewarray java.io.FilePermission
dup
iconst_0
aload 5
aastore
dup
iconst_1
aload 7
aastore
astore 2
end local 8 end local 7 end local 6 end local 5 end local 4 11: StackMap locals: java.io.FilePermission[] java.lang.SecurityManager
StackMap stack:
aload 0
iconst_0
anewarray java.nio.file.LinkOption
invokestatic java.nio.file.Files.notExists:(Ljava/nio/file/Path;[Ljava/nio/file/LinkOption;)Z
ifeq 13
12: new java.lang.IllegalArgumentException
dup
new java.lang.StringBuilder
dup
ldc "non-existent directory: "
invokespecial java.lang.StringBuilder.<init>:(Ljava/lang/String;)V
aload 0
invokevirtual java.lang.StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;
invokevirtual java.lang.StringBuilder.toString:()Ljava/lang/String;
invokespecial java.lang.IllegalArgumentException.<init>:(Ljava/lang/String;)V
athrow
13: StackMap locals:
StackMap stack:
aload 0
iconst_0
anewarray java.nio.file.LinkOption
invokestatic java.nio.file.Files.isDirectory:(Ljava/nio/file/Path;[Ljava/nio/file/LinkOption;)Z
ifne 15
14: new java.lang.IllegalArgumentException
dup
new java.lang.StringBuilder
dup
ldc "not a directory: "
invokespecial java.lang.StringBuilder.<init>:(Ljava/lang/String;)V
aload 0
invokevirtual java.lang.StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;
invokevirtual java.lang.StringBuilder.toString:()Ljava/lang/String;
invokespecial java.lang.IllegalArgumentException.<init>:(Ljava/lang/String;)V
athrow
15: StackMap locals:
StackMap stack:
aload 0
invokestatic java.nio.file.Files.isWritable:(Ljava/nio/file/Path;)Z
ifne 17
16: new java.lang.IllegalArgumentException
dup
new java.lang.StringBuilder
dup
ldc "non-writable directory: "
invokespecial java.lang.StringBuilder.<init>:(Ljava/lang/String;)V
aload 0
invokevirtual java.lang.StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;
invokevirtual java.lang.StringBuilder.toString:()Ljava/lang/String;
invokespecial java.lang.IllegalArgumentException.<init>:(Ljava/lang/String;)V
athrow
17: StackMap locals:
StackMap stack:
new jdk.internal.net.http.ResponseBodyHandlers$FileDownloadBodyHandler
dup
aload 0
aload 1
aload 2
invokespecial jdk.internal.net.http.ResponseBodyHandlers$FileDownloadBodyHandler.<init>:(Ljava/nio/file/Path;Ljava/util/List;[Ljava/io/FilePermission;)V
areturn
end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 18 0 directory Ljava/nio/file/Path;
0 18 1 openOptions Ljava/util/List<Ljava/nio/file/OpenOption;>;
1 18 2 filePermissions [Ljava/io/FilePermission;
2 18 3 sm Ljava/lang/SecurityManager;
4 11 4 fn Ljava/lang/String;
5 11 5 writePermission Ljava/io/FilePermission;
6 11 6 writePathPerm Ljava/lang/String;
7 11 7 writeInDirPermission Ljava/io/FilePermission;
9 11 8 readPermission Ljava/io/FilePermission;
Signature: (Ljava/nio/file/Path;Ljava/util/List<Ljava/nio/file/OpenOption;>;)Ljdk/internal/net/http/ResponseBodyHandlers$FileDownloadBodyHandler;
MethodParameters:
Name Flags
directory
openOptions
private void <init>(java.nio.file.Path, java.util.List<java.nio.file.OpenOption>, java.io.FilePermission[]);
descriptor: (Ljava/nio/file/Path;Ljava/util/List;[Ljava/io/FilePermission;)V
flags: (0x0082) ACC_PRIVATE, ACC_VARARGS
Code:
stack=2, locals=4, args_size=4
start local 0 start local 1 start local 2 start local 3 0: aload 0
invokespecial java.lang.Object.<init>:()V
1: aload 0
aload 1
putfield jdk.internal.net.http.ResponseBodyHandlers$FileDownloadBodyHandler.directory:Ljava/nio/file/Path;
2: aload 0
aload 2
putfield jdk.internal.net.http.ResponseBodyHandlers$FileDownloadBodyHandler.openOptions:Ljava/util/List;
3: aload 0
aload 3
putfield jdk.internal.net.http.ResponseBodyHandlers$FileDownloadBodyHandler.filePermissions:[Ljava/io/FilePermission;
4: return
end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 5 0 this Ljdk/internal/net/http/ResponseBodyHandlers$FileDownloadBodyHandler;
0 5 1 directory Ljava/nio/file/Path;
0 5 2 openOptions Ljava/util/List<Ljava/nio/file/OpenOption;>;
0 5 3 filePermissions [Ljava/io/FilePermission;
Signature: (Ljava/nio/file/Path;Ljava/util/List<Ljava/nio/file/OpenOption;>;[Ljava/io/FilePermission;)V
MethodParameters:
Name Flags
directory
openOptions
filePermissions
static final java.io.UncheckedIOException unchecked(java.net.http.HttpResponse$ResponseInfo, java.lang.String);
descriptor: (Ljava/net/http/HttpResponse$ResponseInfo;Ljava/lang/String;)Ljava/io/UncheckedIOException;
flags: (0x0018) ACC_STATIC, ACC_FINAL
Code:
stack=5, locals=3, args_size=2
start local 0 start local 1 0: ldc "%s in response [%d, %s]"
iconst_3
anewarray java.lang.Object
dup
iconst_0
aload 1
aastore
dup
iconst_1
aload 0
invokeinterface java.net.http.HttpResponse$ResponseInfo.statusCode:()I
invokestatic java.lang.Integer.valueOf:(I)Ljava/lang/Integer;
aastore
dup
iconst_2
aload 0
invokeinterface java.net.http.HttpResponse$ResponseInfo.headers:()Ljava/net/http/HttpHeaders;
aastore
invokestatic java.lang.String.format:(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
astore 2
start local 2 1: new java.io.UncheckedIOException
dup
new java.io.IOException
dup
aload 2
invokespecial java.io.IOException.<init>:(Ljava/lang/String;)V
invokespecial java.io.UncheckedIOException.<init>:(Ljava/io/IOException;)V
areturn
end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 2 0 rinfo Ljava/net/http/HttpResponse$ResponseInfo;
0 2 1 msg Ljava/lang/String;
1 2 2 s Ljava/lang/String;
MethodParameters:
Name Flags
rinfo
msg
public java.net.http.HttpResponse$BodySubscriber<java.nio.file.Path> apply(java.net.http.HttpResponse$ResponseInfo);
descriptor: (Ljava/net/http/HttpResponse$ResponseInfo;)Ljava/net/http/HttpResponse$BodySubscriber;
flags: (0x0001) ACC_PUBLIC
Code:
stack=6, locals=9, args_size=2
start local 0 start local 1 0: aload 1
invokeinterface java.net.http.HttpResponse$ResponseInfo.headers:()Ljava/net/http/HttpHeaders;
ldc "Content-Disposition"
invokevirtual java.net.http.HttpHeaders.firstValue:(Ljava/lang/String;)Ljava/util/Optional;
1: aload 1
invokedynamic get(Ljava/net/http/HttpResponse$ResponseInfo;)Ljava/util/function/Supplier;
Bootstrap: invokestatic java.lang.invoke.LambdaMetafactory.metafactory:(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;
Method arguments:
()Ljava/lang/Object;
jdk/internal/net/http/ResponseBodyHandlers$FileDownloadBodyHandler.lambda$0(Ljava/net/http/HttpResponse$ResponseInfo;)Ljava/io/UncheckedIOException; (6)
()Ljava/io/UncheckedIOException;
invokevirtual java.util.Optional.orElseThrow:(Ljava/util/function/Supplier;)Ljava/lang/Object;
checkcast java.lang.String
2: astore 2
start local 2 3: aload 2
iconst_1
4: iconst_0
ldc "attachment;"
5: iconst_0
ldc "attachment;"
invokevirtual java.lang.String.length:()I
6: invokevirtual java.lang.String.regionMatches:(ZILjava/lang/String;II)Z
7: ifne 9
8: aload 1
ldc "Unknown Content-Disposition type"
invokestatic jdk.internal.net.http.ResponseBodyHandlers$FileDownloadBodyHandler.unchecked:(Ljava/net/http/HttpResponse$ResponseInfo;Ljava/lang/String;)Ljava/io/UncheckedIOException;
athrow
9: StackMap locals: java.lang.String
StackMap stack:
getstatic jdk.internal.net.http.ResponseBodyHandlers$FileDownloadBodyHandler.FILENAME:Ljava/util/regex/Pattern;
aload 2
invokevirtual java.util.regex.Pattern.matcher:(Ljava/lang/CharSequence;)Ljava/util/regex/Matcher;
astore 3
start local 3 10: aload 3
invokevirtual java.util.regex.Matcher.find:()Z
ifne 12
11: aload 1
ldc "Bad Content-Disposition filename parameter"
invokestatic jdk.internal.net.http.ResponseBodyHandlers$FileDownloadBodyHandler.unchecked:(Ljava/net/http/HttpResponse$ResponseInfo;Ljava/lang/String;)Ljava/io/UncheckedIOException;
athrow
12: StackMap locals: java.util.regex.Matcher
StackMap stack:
aload 3
invokevirtual java.util.regex.Matcher.end:()I
istore 4
start local 4 13: aload 2
iload 4
invokevirtual java.lang.String.substring:(I)Ljava/lang/String;
ldc ";"
invokevirtual java.lang.String.indexOf:(Ljava/lang/String;)I
istore 5
start local 5 14: iload 5
ifge 17
15: aload 2
iload 4
invokevirtual java.lang.String.substring:(I)Ljava/lang/String;
astore 6
start local 6 16: goto 18
end local 6 17: StackMap locals: int int
StackMap stack:
aload 2
iload 4
iload 4
iload 5
iadd
invokevirtual java.lang.String.substring:(II)Ljava/lang/String;
astore 6
start local 6 18: StackMap locals: java.lang.String
StackMap stack:
aload 6
ldc "/"
invokevirtual java.lang.String.lastIndexOf:(Ljava/lang/String;)I
istore 7
start local 7 19: iload 7
iconst_m1
if_icmpeq 21
20: aload 6
iload 7
iconst_1
iadd
invokevirtual java.lang.String.substring:(I)Ljava/lang/String;
astore 6
21: StackMap locals: int
StackMap stack:
aload 6
ldc "\\"
invokevirtual java.lang.String.lastIndexOf:(Ljava/lang/String;)I
istore 7
22: iload 7
iconst_m1
if_icmpeq 24
23: aload 6
iload 7
iconst_1
iadd
invokevirtual java.lang.String.substring:(I)Ljava/lang/String;
astore 6
24: StackMap locals:
StackMap stack:
aload 6
invokevirtual java.lang.String.trim:()Ljava/lang/String;
astore 6
25: aload 6
ldc "\""
invokevirtual java.lang.String.startsWith:(Ljava/lang/String;)Z
ifeq 32
26: aload 6
ldc "\""
invokevirtual java.lang.String.endsWith:(Ljava/lang/String;)Z
ifeq 27
aload 6
invokevirtual java.lang.String.length:()I
iconst_1
if_icmpne 30
27: StackMap locals:
StackMap stack:
aload 1
28: ldc "Badly quoted Content-Disposition filename parameter"
29: invokestatic jdk.internal.net.http.ResponseBodyHandlers$FileDownloadBodyHandler.unchecked:(Ljava/net/http/HttpResponse$ResponseInfo;Ljava/lang/String;)Ljava/io/UncheckedIOException;
athrow
30: StackMap locals:
StackMap stack:
aload 6
iconst_1
aload 6
invokevirtual java.lang.String.length:()I
iconst_1
isub
invokevirtual java.lang.String.substring:(II)Ljava/lang/String;
astore 6
31: goto 36
32: StackMap locals:
StackMap stack:
aload 6
ldc " "
invokevirtual java.lang.String.contains:(Ljava/lang/CharSequence;)Z
ifeq 36
33: aload 1
34: ldc "unquoted space in Content-Disposition filename parameter"
35: invokestatic jdk.internal.net.http.ResponseBodyHandlers$FileDownloadBodyHandler.unchecked:(Ljava/net/http/HttpResponse$ResponseInfo;Ljava/lang/String;)Ljava/io/UncheckedIOException;
athrow
36: StackMap locals:
StackMap stack:
getstatic jdk.internal.net.http.ResponseBodyHandlers$FileDownloadBodyHandler.PROHIBITED:Ljava/util/List;
aload 6
invokeinterface java.util.List.contains:(Ljava/lang/Object;)Z
ifeq 42
37: aload 1
38: new java.lang.StringBuilder
dup
ldc "Prohibited Content-Disposition filename parameter:"
invokespecial java.lang.StringBuilder.<init>:(Ljava/lang/String;)V
39: aload 6
invokevirtual java.lang.StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
40: invokevirtual java.lang.StringBuilder.toString:()Ljava/lang/String;
41: invokestatic jdk.internal.net.http.ResponseBodyHandlers$FileDownloadBodyHandler.unchecked:(Ljava/net/http/HttpResponse$ResponseInfo;Ljava/lang/String;)Ljava/io/UncheckedIOException;
athrow
42: StackMap locals:
StackMap stack:
aload 0
getfield jdk.internal.net.http.ResponseBodyHandlers$FileDownloadBodyHandler.directory:Ljava/nio/file/Path;
invokeinterface java.nio.file.Path.toString:()Ljava/lang/String;
iconst_1
anewarray java.lang.String
dup
iconst_0
aload 6
aastore
invokestatic java.nio.file.Paths.get:(Ljava/lang/String;[Ljava/lang/String;)Ljava/nio/file/Path;
astore 8
start local 8 43: aload 8
aload 0
getfield jdk.internal.net.http.ResponseBodyHandlers$FileDownloadBodyHandler.directory:Ljava/nio/file/Path;
invokeinterface java.nio.file.Path.startsWith:(Ljava/nio/file/Path;)Z
ifne 47
44: aload 1
45: new java.lang.StringBuilder
dup
ldc "Resulting file, "
invokespecial java.lang.StringBuilder.<init>:(Ljava/lang/String;)V
aload 8
invokeinterface java.nio.file.Path.toString:()Ljava/lang/String;
invokevirtual java.lang.StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
ldc ", outside of given directory"
invokevirtual java.lang.StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
invokevirtual java.lang.StringBuilder.toString:()Ljava/lang/String;
46: invokestatic jdk.internal.net.http.ResponseBodyHandlers$FileDownloadBodyHandler.unchecked:(Ljava/net/http/HttpResponse$ResponseInfo;Ljava/lang/String;)Ljava/io/UncheckedIOException;
athrow
47: StackMap locals: java.nio.file.Path
StackMap stack:
new jdk.internal.net.http.ResponseSubscribers$PathSubscriber
dup
aload 8
aload 0
getfield jdk.internal.net.http.ResponseBodyHandlers$FileDownloadBodyHandler.openOptions:Ljava/util/List;
aload 0
getfield jdk.internal.net.http.ResponseBodyHandlers$FileDownloadBodyHandler.filePermissions:[Ljava/io/FilePermission;
invokespecial jdk.internal.net.http.ResponseSubscribers$PathSubscriber.<init>:(Ljava/nio/file/Path;Ljava/util/List;[Ljava/io/FilePermission;)V
areturn
end local 8 end local 7 end local 6 end local 5 end local 4 end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 48 0 this Ljdk/internal/net/http/ResponseBodyHandlers$FileDownloadBodyHandler;
0 48 1 responseInfo Ljava/net/http/HttpResponse$ResponseInfo;
3 48 2 dispoHeader Ljava/lang/String;
10 48 3 matcher Ljava/util/regex/Matcher;
13 48 4 n I
14 48 5 semi I
16 17 6 filenameParam Ljava/lang/String;
18 48 6 filenameParam Ljava/lang/String;
19 48 7 x I
43 48 8 file Ljava/nio/file/Path;
Signature: (Ljava/net/http/HttpResponse$ResponseInfo;)Ljava/net/http/HttpResponse$BodySubscriber<Ljava/nio/file/Path;>;
MethodParameters:
Name Flags
responseInfo
private static java.io.UncheckedIOException lambda$0(java.net.http.HttpResponse$ResponseInfo);
descriptor: (Ljava/net/http/HttpResponse$ResponseInfo;)Ljava/io/UncheckedIOException;
flags: (0x100a) ACC_PRIVATE, ACC_STATIC, ACC_SYNTHETIC
Code:
stack=2, locals=1, args_size=1
0: aload 0
ldc "No Content-Disposition header"
invokestatic jdk.internal.net.http.ResponseBodyHandlers$FileDownloadBodyHandler.unchecked:(Ljava/net/http/HttpResponse$ResponseInfo;Ljava/lang/String;)Ljava/io/UncheckedIOException;
areturn
LocalVariableTable:
Start End Slot Name Signature
}
Signature: Ljava/lang/Object;Ljava/net/http/HttpResponse$BodyHandler<Ljava/nio/file/Path;>;
SourceFile: "ResponseBodyHandlers.java"
NestHost: jdk.internal.net.http.ResponseBodyHandlers
InnerClasses:
public final Lookup = java.lang.invoke.MethodHandles$Lookup of java.lang.invoke.MethodHandles
public abstract BodyHandler = java.net.http.HttpResponse$BodyHandler of java.net.http.HttpResponse
public abstract BodySubscriber = java.net.http.HttpResponse$BodySubscriber of java.net.http.HttpResponse
public abstract ResponseInfo = java.net.http.HttpResponse$ResponseInfo of java.net.http.HttpResponse
public FileDownloadBodyHandler = jdk.internal.net.http.ResponseBodyHandlers$FileDownloadBodyHandler of jdk.internal.net.http.ResponseBodyHandlers
public PathSubscriber = jdk.internal.net.http.ResponseSubscribers$PathSubscriber of jdk.internal.net.http.ResponseSubscribers