class org.flywaydb.commandline.FileLogCreator implements org.flywaydb.core.api.logging.LogCreator
minor version: 0
major version: 59
flags: flags: (0x0020) ACC_SUPER
this_class: org.flywaydb.commandline.FileLogCreator
super_class: java.lang.Object
{
private final org.flywaydb.commandline.ConsoleLog$Level level;
descriptor: Lorg/flywaydb/commandline/ConsoleLog$Level;
flags: (0x0012) ACC_PRIVATE, ACC_FINAL
private final java.nio.file.Path path;
descriptor: Ljava/nio/file/Path;
flags: (0x0012) ACC_PRIVATE, ACC_FINAL
void <init>(org.flywaydb.commandline.CommandLineArguments);
descriptor: (Lorg/flywaydb/commandline/CommandLineArguments;)V
flags: (0x0000)
Code:
stack=3, locals=3, args_size=2
start local 0 // org.flywaydb.commandline.FileLogCreator this
start local 1 // org.flywaydb.commandline.CommandLineArguments commandLineArguments
0: .line 41
aload 0 /* this */
invokespecial java.lang.Object.<init>:()V
1: .line 42
ldc ""
astore 2 /* outputFilepath */
start local 2 // java.lang.String outputFilepath
2: .line 44
aload 1 /* commandLineArguments */
invokevirtual org.flywaydb.commandline.CommandLineArguments.isOutputFileSet:()Z
ifeq 5
3: .line 45
aload 1 /* commandLineArguments */
invokevirtual org.flywaydb.commandline.CommandLineArguments.getOutputFile:()Ljava/lang/String;
astore 2 /* outputFilepath */
4: .line 46
goto 7
StackMap locals: org.flywaydb.commandline.FileLogCreator org.flywaydb.commandline.CommandLineArguments java.lang.String
StackMap stack:
5: aload 1 /* commandLineArguments */
invokevirtual org.flywaydb.commandline.CommandLineArguments.isLogFilepathSet:()Z
ifeq 7
6: .line 47
aload 1 /* commandLineArguments */
invokevirtual org.flywaydb.commandline.CommandLineArguments.getLogFilepath:()Ljava/lang/String;
astore 2 /* outputFilepath */
7: .line 50
StackMap locals:
StackMap stack:
aload 0 /* this */
aload 1 /* commandLineArguments */
invokevirtual org.flywaydb.commandline.CommandLineArguments.getLogLevel:()Lorg/flywaydb/commandline/ConsoleLog$Level;
putfield org.flywaydb.commandline.FileLogCreator.level:Lorg/flywaydb/commandline/ConsoleLog$Level;
8: .line 51
aload 0 /* this */
aload 2 /* outputFilepath */
iconst_0
anewarray java.lang.String
invokestatic java.nio.file.Paths.get:(Ljava/lang/String;[Ljava/lang/String;)Ljava/nio/file/Path;
putfield org.flywaydb.commandline.FileLogCreator.path:Ljava/nio/file/Path;
9: .line 53
aload 0 /* this */
getfield org.flywaydb.commandline.FileLogCreator.path:Ljava/nio/file/Path;
invokestatic org.flywaydb.commandline.FileLogCreator.prepareOutputFile:(Ljava/nio/file/Path;)V
10: .line 54
return
end local 2 // java.lang.String outputFilepath
end local 1 // org.flywaydb.commandline.CommandLineArguments commandLineArguments
end local 0 // org.flywaydb.commandline.FileLogCreator this
LocalVariableTable:
Start End Slot Name Signature
0 11 0 this Lorg/flywaydb/commandline/FileLogCreator;
0 11 1 commandLineArguments Lorg/flywaydb/commandline/CommandLineArguments;
2 11 2 outputFilepath Ljava/lang/String;
MethodParameters:
Name Flags
commandLineArguments
public org.flywaydb.core.api.logging.Log createLogger(java.lang.Class<?>);
descriptor: (Ljava/lang/Class;)Lorg/flywaydb/core/api/logging/Log;
flags: (0x0001) ACC_PUBLIC
Code:
stack=4, locals=2, args_size=2
start local 0 // org.flywaydb.commandline.FileLogCreator this
start local 1 // java.lang.Class clazz
0: .line 57
new org.flywaydb.commandline.FileLog
dup
aload 0 /* this */
getfield org.flywaydb.commandline.FileLogCreator.path:Ljava/nio/file/Path;
aload 0 /* this */
getfield org.flywaydb.commandline.FileLogCreator.level:Lorg/flywaydb/commandline/ConsoleLog$Level;
invokespecial org.flywaydb.commandline.FileLog.<init>:(Ljava/nio/file/Path;Lorg/flywaydb/commandline/ConsoleLog$Level;)V
areturn
end local 1 // java.lang.Class clazz
end local 0 // org.flywaydb.commandline.FileLogCreator this
LocalVariableTable:
Start End Slot Name Signature
0 1 0 this Lorg/flywaydb/commandline/FileLogCreator;
0 1 1 clazz Ljava/lang/Class<*>;
Signature: (Ljava/lang/Class<*>;)Lorg/flywaydb/core/api/logging/Log;
MethodParameters:
Name Flags
clazz
private static void prepareOutputFile(java.nio.file.Path);
descriptor: (Ljava/nio/file/Path;)V
flags: (0x000a) ACC_PRIVATE, ACC_STATIC
Code:
stack=6, locals=2, args_size=1
start local 0 // java.nio.file.Path path
0: .line 62
aload 0 /* path */
ldc ""
invokevirtual java.lang.String.getBytes:()[B
iconst_3
anewarray java.nio.file.OpenOption
dup
iconst_0
getstatic java.nio.file.StandardOpenOption.WRITE:Ljava/nio/file/StandardOpenOption;
aastore
dup
iconst_1
getstatic java.nio.file.StandardOpenOption.TRUNCATE_EXISTING:Ljava/nio/file/StandardOpenOption;
aastore
dup
iconst_2
getstatic java.nio.file.StandardOpenOption.CREATE:Ljava/nio/file/StandardOpenOption;
aastore
invokestatic java.nio.file.Files.write:(Ljava/nio/file/Path;[B[Ljava/nio/file/OpenOption;)Ljava/nio/file/Path;
pop
1: .line 63
goto 4
StackMap locals:
StackMap stack: java.io.IOException
2: astore 1 /* exception */
start local 1 // java.io.IOException exception
3: .line 64
new org.flywaydb.core.api.FlywayException
dup
new java.lang.StringBuilder
dup
ldc "Could not initialize log file at "
invokespecial java.lang.StringBuilder.<init>:(Ljava/lang/String;)V
aload 0 /* path */
invokevirtual java.lang.StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;
ldc "."
invokevirtual java.lang.StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
invokevirtual java.lang.StringBuilder.toString:()Ljava/lang/String;
aload 1 /* exception */
invokespecial org.flywaydb.core.api.FlywayException.<init>:(Ljava/lang/String;Ljava/lang/Throwable;)V
athrow
end local 1 // java.io.IOException exception
4: .line 66
StackMap locals:
StackMap stack:
return
end local 0 // java.nio.file.Path path
LocalVariableTable:
Start End Slot Name Signature
0 5 0 path Ljava/nio/file/Path;
3 4 1 exception Ljava/io/IOException;
Exception table:
from to target type
0 1 2 Class java.io.IOException
MethodParameters:
Name Flags
path
}
SourceFile: "FileLogCreator.java"
InnerClasses:
public final Level = org.flywaydb.commandline.ConsoleLog$Level of org.flywaydb.commandline.ConsoleLog