FileSystemCacheBackend implements ICacheBackend { String getSystemTmp() { String s = System.getProperty( "java.io.tmpdir" ); final char c = s.charAt( s.length() - 1 ); if ( ( c != '/' ) && ( c != '\\' ) ) { s += File.separator; System.setProperty( "java.io.tmpdir", s ); } return s; } FileSystemCacheBackend(); void setCachePath( final String cachePath ); @Override boolean write( final List<String> key, final Serializable value,
                        final Map<String, Serializable> metaData ); @Override Serializable read( final List<String> key ); Map<String, Serializable> readMetaData( final List<String> key ); void purgeSegment( final List<String> key,
                            final BiPredicate<List<String>, Map<String, Serializable>> p ); @Override boolean purge( final List<String> key ); static final String REPLACEMENT; static final String SLASHES; static final String EXT; static final String DATA; static final String METADATA; }
@Test public void testSystemTmp() { final String property = System.getProperty( "java.io.tmpdir" ); final char c = property.charAt( property.length() - 1 ); if ( ( c == '/' ) || ( c == '\\' ) ) { System.setProperty( "java.io.tmpdir", property.substring( 0, property.length() - 1 ) ); } final String systemTmp = fileSystemCacheBackend.getSystemTmp(); Assert.assertEquals( property, systemTmp ); }