MCPcopy Create free account
hub / github.com/GateNLP/gate-core / getFileSuffix

Method getFileSuffix

src/main/java/gate/DocumentFormat.java:446–466  ·  view source on GitHub ↗

Return the fileSuffix or null if the url doesn't have a file suffix If the url is null then the file suffix will be null also

(URL url)

Source from the content-addressed store, hash-verified

444 * If the url is null then the file suffix will be null also
445 */
446 @SuppressWarnings("unused")
447 private static String getFileSuffix(URL url){
448 String fileName = null;
449 String fileSuffix = null;
450
451 // GIGO test (garbage in garbage out)
452 if (url != null){
453 // get the file name from the URL
454 fileName = url.getFile();
455
456 // tokenize this file name with "." as separator...
457 // the last token will be the file suffix
458 StringTokenizer st = new StringTokenizer(fileName,".");
459
460 // fileSuffix is the last token
461 while (st.hasMoreTokens())
462 fileSuffix = st.nextToken();
463 // here fileSuffix is the last token
464 } // End if
465 return fileSuffix;
466 }//getFileSufix
467
468 /**
469 * Given a URL, this method returns all the 'file extensions' for the file

Callers

nothing calls this directly

Calls 1

getFileMethod · 0.45

Tested by

no test coverage detected