Java File Name Extract extractFileName(StackTraceElement aFrame)

Here you can find the source of extractFileName(StackTraceElement aFrame)

Description

extract File Name

License

Apache License

Declaration

private static String extractFileName(StackTraceElement aFrame) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    private static String extractFileName(StackTraceElement aFrame) {
        String fileName = aFrame.getFileName();
        if (fileName != null) {
            int atIndex = fileName.indexOf("@");
            if (atIndex != -1) {
                fileName = fileName.substring(0, atIndex);
            }//from w  w  w. ja  v a2s .  c  om
            return fileName;
        } else {
            return null;
        }
    }
}

Related

  1. extractFileName(final String filePath)
  2. extractFileName(String file)
  3. extractFileName(String fileName)
  4. extractFileName(String filePathName)
  5. extractFileName(String filePathName)