@Test public void removeShouldRemoveExtension() throws Exception { final String actual = Extensions.remove("foo.java", JavaFileType.INSTANCE); assertThat(actual) .isEqualTo("foo"); }
@Nonnull @CheckReturnValue public static String remove(@Nonnull String fileName, @Nonnull FileType fileType) { final String extension = fileType.getDefaultExtension(); if (fileName.endsWith(DELIMITER + extension)) { return fileName.substring(0, fileName.length() - (extension.length() + 1)); } return fileName; }
Extensions { @Nonnull @CheckReturnValue public static String remove(@Nonnull String fileName, @Nonnull FileType fileType) { final String extension = fileType.getDefaultExtension(); if (fileName.endsWith(DELIMITER + extension)) { return fileName.substring(0, fileName.length() - (extension.length() + 1)); } return fileName; } }
Extensions { @Nonnull @CheckReturnValue public static String remove(@Nonnull String fileName, @Nonnull FileType fileType) { final String extension = fileType.getDefaultExtension(); if (fileName.endsWith(DELIMITER + extension)) { return fileName.substring(0, fileName.length() - (extension.length() + 1)); } return fileName; } private  Extensions(); }
Extensions { @Nonnull @CheckReturnValue public static String remove(@Nonnull String fileName, @Nonnull FileType fileType) { final String extension = fileType.getDefaultExtension(); if (fileName.endsWith(DELIMITER + extension)) { return fileName.substring(0, fileName.length() - (extension.length() + 1)); } return fileName; } private  Extensions(); @Nonnull @CheckReturnValue static String remove(@Nonnull String fileName, @Nonnull FileType fileType); @Nonnull @CheckReturnValue static String append(@Nonnull String fileName, @Nonnull FileType fileType); }
Extensions { @Nonnull @CheckReturnValue public static String remove(@Nonnull String fileName, @Nonnull FileType fileType) { final String extension = fileType.getDefaultExtension(); if (fileName.endsWith(DELIMITER + extension)) { return fileName.substring(0, fileName.length() - (extension.length() + 1)); } return fileName; } private  Extensions(); @Nonnull @CheckReturnValue static String remove(@Nonnull String fileName, @Nonnull FileType fileType); @Nonnull @CheckReturnValue static String append(@Nonnull String fileName, @Nonnull FileType fileType);  }