protected String getSuffix( final String filename ) { final String suffix = IOUtils.getInstance().getFileExtension( filename ); if ( suffix.length() == 0 ) { return ""; //$NON-NLS-1$ } return suffix.substring( 1 ); } }
private static String getSuffix( final String filename ) { final String suffix = IOUtils.getInstance().getFileExtension( filename ); if ( suffix.length() == 0 ) { return ""; } return suffix.substring( 1 ); }
private String getSuffix( final String filename ) { final String suffix = IOUtils.getInstance().getFileExtension( filename ); if ( suffix.length() == 0 ) { return ""; //$NON-NLS-1$ } return suffix.substring( 1 ); }
private String getSuffix( final String filename ) { final String suffix = IOUtils.getInstance().getFileExtension( filename ); if ( suffix.length() == 0 ) { return ""; //$NON-NLS-1$ } return suffix.substring( 1 ); }
/** * Queries the mime-type for a given filename. Some repositories store mime-type information along with the content * data, while others might resort to heuristics based on the filename or actual data stored in the item. * * @param filename the content item for which Mime-Data should be queried. * @return the mime-type never null. */ public String getMimeType( final String filename ) { if ( filename == null ) { return defaultMimeType; } final String extension = IOUtils.getInstance().getFileExtension( filename ).toLowerCase(); return configuration.getConfigProperty( SUFFIX_KEY_PREFIX + extension, "application/octet-stream" ); }
/** * Queries the mime-type for a given content-item. Some repositories store mime-type information along with the * content data, while others might resort to heuristics based on the filename or actual data stored in the item. * * @param item the content item for which Mime-Data should be queried. * @return the mime-type never null. */ public String getMimeType( final ContentItem item ) { final String name = item.getName(); if ( name == null ) { return defaultMimeType; } final String extension = IOUtils.getInstance().getFileExtension( name ).toLowerCase(); return configuration.getConfigProperty( SUFFIX_KEY_PREFIX + extension, "application/octet-stream" ); }
String fileExtension = IOUtils.getInstance().getFileExtension( fileNameWExt ); if ( StringUtils.isEmpty( fileExtension ) ) { fileExtension = "." + mimeRegistry.getSuffix( mimeType );