1
2
3
4
5
6
7
8
9
10
11 package psiprobe.tools.logging.jdk;
12
13 import java.io.File;
14
15 import psiprobe.tools.Instruments;
16
17
18
19
20 public class Jdk14FileHandlerAccessor extends Jdk14HandlerAccessor {
21
22
23 private static final int LATEST_FILE_INDEX = 0;
24
25
26
27
28 @Override
29 public File getFile() {
30 File[] files = (File[]) Instruments.getField(getTarget(), "files");
31 if (files == null || files.length == 0) {
32 throw new IllegalStateException("File handler does not manage any files");
33 }
34 return files[LATEST_FILE_INDEX];
35 }
36
37 }