Find file file.

@param callingFrame the calling frame
@return the file
2138
@javax.annotation.Nonnull
  public static File findFile(@javax.annotation.Nonnull final StackTraceElement callingFrame) {
    @javax.annotation.Nonnull final String[] packagePath = callingFrame.getClassName().split("\\.");
    @javax.annotation.Nonnull final String path = Arrays.stream(packagePath).limit(packagePath.length - 1).collect(Collectors.joining(File.separator)) + File.separator + callingFrame.getFileName();
    return com.simiacryptus.util.lang.CodeUtil.findFile(path);
  }
786588
@Override
    File getFile() {
        if (logicalZipFile != null) {
            return logicalZipFile.getPhysicalFile();
        } else {
            // Not performing a full scan (only getting classpath elements), so logicalZipFile is not set
            final int plingIdx = rawPath.indexOf('!');
            final String outermostZipFilePathResolved = FastPathResolver.resolve(FileUtils.CURR_DIR_PATH,
                    plingIdx < 0 ? rawPath : rawPath.substring(0, plingIdx));
            return new File(outermostZipFilePathResolved);
        }
    }
113189
File getSyncLogDestFile(long segmentTxId, long endTxId) {
    String name = NNStorage.getFinalizedEditsFileName(segmentTxId, endTxId); 
    return new File(sd.getCurrentDir(), name);
  }
1321431
def findCaller(self):
        
        f = currentframe()
        #On some versions of IronPython, currentframe() returns None if
        #IronPython isn't run with -X:Frames.
        if f is not None:
            f = f.f_back
        rv = "(unknown file)", 0, "(unknown function)", None
        while hasattr(f, "f_code"):
            co = f.f_code
            filename = os.path.normcase(co.co_filename)
            if filename == _srcfile:
                f = f.f_back
                continue
            rv = (co.co_filename, f.f_lineno, co.co_name)
            break
        return rv
839674
public static File locateFile(String fname) {
    // When run from eclipse, the working directory is different.
    // Try pointing at another likely place
    File file = new File(fname);
    if( !file.exists() )
      file = new File("target/" + fname);
    if( !file.exists() )
      file = new File("../" + fname);
    if( !file.exists() )
      file = new File("../../" + fname);
    if( !file.exists() )
      file = new File("../../../" + fname);
    if( !file.exists() )
      file = new File("../target/" + fname);
    if( !file.exists() )
      file = new File(StringUtils.expandPath(fname));
    if( !file.exists() )
      file = null;
    return file;
  }
833629
@Nullable
  public static File findFile(@Nullable final Class<?> clazz) {
    if (null == clazz) return null;
    String name = clazz.getName();
    if (null == name) return null;
    final String path = name.replaceAll("\\.", "/").replaceAll("\\$.*", "");
    return com.simiacryptus.util.lang.CodeUtil.findFile(path + ".java");
  }
135226
public static File findInstanceResourcesDirectory( File applicationFilesDirectory, Instance instance ) {
		return findInstanceResourcesDirectory( applicationFilesDirectory, instance.getComponent());
	}
958301
static String getFile( String name )
        throws FileNotFoundException, IOException
    {
        StringBuilder sb = new StringBuilder();
        try ( BufferedReader bin = new BufferedReader( new FileReader( name ) ) ) {
            String line;
            while ( (line=bin.readLine()) != null )
                sb.append( line ).append( "\n" );
        }
        return sb.toString();
    }
1281722
public File getAsFile(String bucket, String fname) throws IOException {
    Storage.Objects.Get request = storage.objects().get(bucket, fname);
    File file = File.createTempFile("gcsdownload", "obj");
    try (OutputStream out = new FileOutputStream(file)) {
      request.executeMediaAndDownloadTo(out);
    }
    return file;
  }
1207439
public FileChannel getFileChannel() {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "getFileChannel(): " + fc);
        }
        return this.fc;
    }
474031
public IFile findIFile(File file)
	{
		IPath location = Path.fromOSString(file.getAbsolutePath());
		IFile ifile = project.getFile(location);

		if (ifile == null || !ifile.exists())
		{

			IPath absolutePath = new Path(file.getAbsolutePath());
			// check if the project contains a IFile which maps to the same
			// file system location
			try
			{
				for (IVdmSourceUnit f : getSpecFiles())
				{
					if (f.getFile().getLocation().equals(absolutePath))
						return f.getFile();
				}
			} catch (CoreException e1)
			{
			}

			// project does not contain this file, this means that the file has
			// been include elsewhere and a link will be created to the file
			// instead.
			try
			{
				linkFileToProject(file);
			} catch (CoreException e)
			{
			}

		}
		return ifile;
	}
245394
public String getSourceFile() {
        if ( sourceFile == null )
            if ( parent != null )
                return ((SimpleNode)parent).getSourceFile();
            else
                return "<unknown file>";
        else
            return sourceFile;
    }
732140
private static FrameInfo getLoggingFrame() {
        StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace();
        StackTraceElement loggingFrame = null;
        /*
         * We need to dig through all the frames until we get to a frame that contains this class, then dig through all
         * frames for this class, to finally come to a point where we have the frame for the calling method.
         */
        // Skip stackTrace[0], which is getStackTrace() on Win32 JDK 1.6.
        for (int ix = 1; ix < stackTrace.length; ix++) {
            loggingFrame = stackTrace[ix];
            if (loggingFrame.getClassName().contains(CLASS_NAME)) {
                for (int iy = ix; iy < stackTrace.length; iy++) {
                    loggingFrame = stackTrace[iy];
                    if (!loggingFrame.getClassName().contains(CLASS_NAME)) {
                        break;
                    }
                }
                break;
            }
        }
        return new FrameInfo(loggingFrame.getClassName(), loggingFrame.getMethodName());
    }
1186434
@javax.annotation.Nonnull
  public static File findFile(@javax.annotation.Nonnull final String path) {
    for (final File root : com.simiacryptus.util.lang.CodeUtil.codeRoots) {
      @javax.annotation.Nonnull final File file = new File(root, path);
      if (file.exists()) return file;
    }
    throw new RuntimeException(String.format("Not Found: %s; Project Roots = %s", path, com.simiacryptus.util.lang.CodeUtil.codeRoots));
  }
113341
public File getFile()
        throws IOException
    {
        // Try the permission hack
        if (checkConnection())
        {
            Permission perm = _connection.getPermission();
            if (perm instanceof java.io.FilePermission)
                return new File(perm.getName());
        }

        // Try the URL file arg
        try {return new File(_url.getFile());}
        catch(Exception e) {LogSupport.ignore(log,e);}

        // Don't know the file
        return null;    
    }
75192
public VirtualFile getFile(VirtualFile mountPoint, VirtualFile target) {
        final String path = target.getPathNameRelativeTo(mountPoint);
        return rootNode.getFile(new Path(path), mountPoint);
    }
691668
@Override
   public InputStream lookupFile(String filename, ClassLoader cl) {
      try {
         return lookupFileStrict( filename, cl );
      }
      catch (FileNotFoundException e) {
         return null;
      }
   }