private static boolean checkThemeFile ( final String name ) { return ! ( Util . empty ( name ) // name must exist || name . contains ( ".." ) // prevent directory traversal || name . charAt ( 0 ) == ' ' // all theme references should be relative || name . indexOf ( ' ' ) != - 1 // forbid use of protocols such as jar:, http: etc. ) ; }
Performs basic sanity checks on the file being requested .