OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libjava/] [gnu/] [gcj/] [tools/] [gc_analyze/] [ToolPrefix.java] - Blame information for rev 756

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 756 jeremybenn
/* ToolPrefix.java -- Container of the toolPrefix String.
2
   Copyright (C) 2007  Free Software Foundation
3
 
4
   This file is part of libgcj.
5
 
6
This software is copyrighted work licensed under the terms of the
7
Libgcj License.  Please consult the file "LIBGCJ_LICENSE" for
8
details.  */
9
 
10
package gnu.gcj.tools.gc_analyze;
11
 
12
import java.io.File;
13
 
14
class ToolPrefix
15
{
16
  /**
17
   * Private constructor.  No creation allowed.  This class has
18
   * Static methods only.
19
    */
20
  private ToolPrefix()
21
  {
22
  }
23
 
24
  static String toolPrefix = "";
25
 
26
  static String pathPrefix = "";
27
 
28
  static File fileForName(String filename)
29
  {
30
    File f = new File(pathPrefix + filename);
31
    if (!f.canRead())
32
      {
33
        // Try it without the prefix.
34
        f = new File(filename);
35
        if (!f.canRead())
36
          {
37
            // Try to find it in the current directory.
38
            f = new File(f.getName());
39
            if (!f.canRead())
40
              return null;
41
          }
42
      }
43
    return f;
44
  }
45
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.