/* (non-Javadoc)
@see org.apereo.portal.io.xml.IDataExporter#getFileName(java.lang.Object)
188252
@Override
    public String getFileName(Tuple<String, Element> data) {
        return SafeFilenameUtils.makeSafeFilename(data.first);
    }
23490
public com.google.protobuf.ByteString
      getFilenameTensorNameBytes() {
    java.lang.Object ref = filenameTensorName_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      filenameTensorName_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }
84955
public static String getSubFileName(String fileName, String parentFileName) {
		if (parentFileName == null) {
			return fileName;
		}
		if (fileName.startsWith("/")) {
			return fileName;
		}
		int index = parentFileName.lastIndexOf('/');
		if (index == -1) {
			return fileName;
		}
		return parentFileName.substring(0, index + 1) + fileName;
	}
666502
@Pure
	public String getDBFFieldName(int index) {
		if (this.fieldCount != -1) {
			try {
				final DBaseFileField field = this.fields.get(index);
				if (field != null) {
					return field.getName();
				}
			} catch (Exception exception) {
				//
			}
		}
		return null;
	}
1034647
def GetFilename(self):
    
    if not self._file_entry:
      return None

    data_stream = getattr(self._file_entry.path_spec, 'data_stream', None)
    if data_stream:
      return '{0:s}:{1:s}'.format(self._file_entry.name, data_stream)

    return self._file_entry.name
1232819
public static String getFilename(String path) throws IllegalArgumentException {
        if (Pattern.matches(sPatternUrl, path))
            return getURLFilename(path);

        return new File(path).getName();
    }
184833
private String getFileName(MultivaluedMap<String, String> header) {

		String[] contentDisposition = header.getFirst("Content-Disposition").split(";");

		for (String filename : contentDisposition) {
			if ((filename.trim().startsWith("filename"))) {

				String[] name = filename.split("=");

				String finalFileName = name[1].trim().replaceAll("\"", "");
				return finalFileName;
			}
		}
		return "unknown";
	}
167378
public static String getFilenameFromHeader(String url, String contentDisposition) {
    String filename;
    if (!TextUtils.isEmpty(contentDisposition)) {
      int index = contentDisposition.indexOf("filename");
      if (index > 0) {
        filename = contentDisposition.substring(index + 9, contentDisposition.length());
        return filename;
      } else {
        filename = getFilenameFromUrl(url);
      }
    } else {
      filename = getFilenameFromUrl(url);
    }

    try {
      filename = URLDecoder.decode(filename, "UTF-8");
    } catch (UnsupportedEncodingException e) {
      /* ignore */
    }

    return filename;
  }
1360966
public String getFileName() {

        CmsMacroResolver resolver = new CmsMacroResolver();
        resolver.addMacro("version", OpenCms.getModuleManager().getModule(m_moduleName).getVersionStr());
        return resolver.resolveMacros(m_fileName);
    }
854488
private static String getFileName(String[] args)
	{
		String fileName = null;
		for (int i=0; i<args.length; i++)
		{
			if (!args[i].startsWith("-"))
			{
				fileName = args[i];
				break;
			}
		}
		return fileName;
	}
239143
public static String getName(String fileName){
        int dot = fileName.lastIndexOf('.');
        return dot==-1 ? fileName : fileName.substring(0, dot);
    }
509668
protected synchronized String getFileName(Map result, String fileType) {
        String exname = getExName(result);
        String crid;
        if (getValueOr(result, "seasonal_dome_applied", "N").equals("Y")) {
            crid = "SN";
        } else {
            crid = getCrid(result);
        }
        if (exname.length() == 10) {
            if (crid.equals("XX") || crid.equals("FA")) {
                crid = exname.substring(exname.length() - 2, exname.length());
            }
        }

        String ret;
        if (exToFileMap.containsKey(exname + "_" + crid)) {
            return exToFileMap.get(exname + "_" + crid) + fileType;
        } else {
            ret = exname;
            if (ret.equals("")) {
                ret = "TEMP0001";
            } else {
                try {
                    if (ret.endsWith(crid)) {
                        ret = ret.substring(0, ret.length() - crid.length());
                    }
                    // If the exname is too long
                    if (ret.length() > 8) {
                        ret = ret.substring(0, 8);
                    }
                    // If the exname do not follow the Dssat rule
                    if (!ret.matches("[\\w ]{1,6}\\d{2}$")) {
                        if (ret.length() > 6) {
                            ret = ret.substring(0, 6);
                        }
                        ret += "01";
                    }
                } catch (Exception e) {
                    ret = "TEMP0001";
                }
            }

            // Special handling for batch
            if (exname.matches(".+_\\d+_b\\S+(__\\d+)?$")) {
                int idx = exname.lastIndexOf("_b") + 2;
                ret += "B" + exname.substring(idx).replaceAll("__\\d+$", "");
            }

            // Find a non-repeated file name
            int count;
            while (fileNameSet.contains(ret + "." + crid)) {
                try {
                    count = Integer.parseInt(ret.substring(ret.length() - 2, ret.length()));
                    count++;
                } catch (Exception e) {
                    count = 1;
                }
                ret = ret.replaceAll("\\w{2}$", String.format("%02d", count));
            }
        }

        exToFileMap.put(exname + "_" + crid, ret + "." + crid);
        fileNameSet.add(ret + "." + crid);

        return ret + "." + crid + fileType;
    }
1231206
@Override
    public String getSubmittedFileName() {
        if (_part.isFormField()) {
            return null;
        }
        if (TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) {  //306998.15
            logger.logp(Level.FINE, CLASS_NAME,"getSubmittedFileName()",_part.getName());
        }
        return _part.getName();
    }
196566
public static String getFilenameExtension(String name) {
    if(name == null) {
      return null;
    }
    int index = name.lastIndexOf('.');
    return index < 0 ? null : name.substring(index + 1).toLowerCase();
  }
925737
protected synchronized String getWthFileName(Map data) {

//        String agmipFileHack = getValueOr(wthFile, "wst_name", "");
//        if (agmipFileHack.length() == 8) {
//            return agmipFileHack;
//        }
        String ret = getObjectOr(data, "wst_id", "");
        if (ret.equals("") || ret.length() > 8) {
            ret = wthHelper.createWthFileName(getObjectOr(data, "weather", data));
            if (ret.equals("")) {
                ret = "AGMP";
            }
        }

        return ret;
    }
164247
public static String getPrefixOfFileName(String fileName) {
        int dotIndex = fileName.lastIndexOf(DOT);
        return dotIndex > 0 ? fileName.substring(0, dotIndex) : fileName;
    }
565876
@Nullable
  public String getSourceFileName() {
    StaticSourceFile file = getStaticSourceFile();
    return file == null ? null : file.getName();
  }