MCPcopy Create free account
hub / github.com/OpenSourcePhysics/osp / getName

Method getName

src/org/opensourcephysics/controls/XML.java:228–241  ·  view source on GitHub ↗

Gets the name from the specified path. @param path the full path @return the name alone

(String path)

Source from the content-addressed store, hash-verified

226 * @return the name alone
227 */
228 public static String getName(String path) {
229 if(path==null) {
230 return ""; //$NON-NLS-1$
231 }
232 // remove path
233 int i = path.lastIndexOf("/"); //$NON-NLS-1$
234 if(i==-1) {
235 i = path.lastIndexOf("\\"); //$NON-NLS-1$
236 }
237 if(i!=-1) {
238 return path.substring(i+1);
239 }
240 return path;
241 }
242
243 /**
244 * Gets the extension of the specified file name.

Callers 15

JarNodeMethod · 0.95
actionPerformedMethod · 0.95
getTitleMethod · 0.95
parseDataMethod · 0.95
openMethod · 0.95
createGUIMethod · 0.95
LaunchSetMethod · 0.95
getDisplayNameMethod · 0.95
getThumbnailFileMethod · 0.95
setTabSetNameMethod · 0.95
getSearchCacheFileMethod · 0.95
getCacheFileMethod · 0.95

Calls

no outgoing calls

Tested by 6

actionPerformedMethod · 0.76
openDnDResourceMethod · 0.76
openLibraryResourceMethod · 0.76
loadIntoEditorMethod · 0.76
AsyncLoaderMethod · 0.76
doInBackgroundAsyncMethod · 0.76