View Javadoc
1   /*
2    * Licensed under the GPL License. You may not use this file except in compliance with the License.
3    * You may obtain a copy of the License at
4    *
5    *   https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
6    *
7    * THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
8    * WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
9    * PURPOSE.
10   */
11  package psiprobe.tools.logging.jdk;
12  
13  import java.io.File;
14  
15  import psiprobe.tools.Instruments;
16  
17  /**
18   * The Class JuliHandlerAccessor.
19   */
20  public class JuliHandlerAccessor extends Jdk14HandlerAccessor {
21  
22    @Override
23    public File getFile() {
24      String dir = (String) Instruments.getField(getTarget(), "directory");
25      String prefix = (String) Instruments.getField(getTarget(), "prefix");
26      String suffix = (String) Instruments.getField(getTarget(), "suffix");
27      String date = (String) Instruments.getField(getTarget(), "date");
28      return dir != null && prefix != null && suffix != null && date != null
29          ? new File(dir, prefix + date + suffix)
30          : getStdoutFile();
31    }
32  
33  }