@Test public void testBasic() { assertThat(CommandLineUtils.getLibraryNameFromLibraryFilename( new File("/path/to/libmyfile.a"))).isEqualTo("myfile"); }
@NotNull public static String getLibraryNameFromLibraryFilename(@NotNull File library) { String name = library.getName(); if (failIf(!name.startsWith("lib"), "Library name from manifest wasn't in the form libXXXX.a")) { return name; } if (failIf(!name.endsWith(".a"), "Library name from manifest wasn't in the form libXXXX.a")) { return name; } name = name.substring(3, name.length() - 2); return name; }
CommandLineUtils { @NotNull public static String getLibraryNameFromLibraryFilename(@NotNull File library) { String name = library.getName(); if (failIf(!name.startsWith("lib"), "Library name from manifest wasn't in the form libXXXX.a")) { return name; } if (failIf(!name.endsWith(".a"), "Library name from manifest wasn't in the form libXXXX.a")) { return name; } name = name.substring(3, name.length() - 2); return name; } }
CommandLineUtils { @NotNull public static String getLibraryNameFromLibraryFilename(@NotNull File library) { String name = library.getName(); if (failIf(!name.startsWith("lib"), "Library name from manifest wasn't in the form libXXXX.a")) { return name; } if (failIf(!name.endsWith(".a"), "Library name from manifest wasn't in the form libXXXX.a")) { return name; } name = name.substring(3, name.length() - 2); return name; }  }
CommandLineUtils { @NotNull public static String getLibraryNameFromLibraryFilename(@NotNull File library) { String name = library.getName(); if (failIf(!name.startsWith("lib"), "Library name from manifest wasn't in the form libXXXX.a")) { return name; } if (failIf(!name.endsWith(".a"), "Library name from manifest wasn't in the form libXXXX.a")) { return name; } name = name.substring(3, name.length() - 2); return name; }  @NotNull static String getLibraryNameFromLibraryFilename(@NotNull File library); }
CommandLineUtils { @NotNull public static String getLibraryNameFromLibraryFilename(@NotNull File library) { String name = library.getName(); if (failIf(!name.startsWith("lib"), "Library name from manifest wasn't in the form libXXXX.a")) { return name; } if (failIf(!name.endsWith(".a"), "Library name from manifest wasn't in the form libXXXX.a")) { return name; } name = name.substring(3, name.length() - 2); return name; }  @NotNull static String getLibraryNameFromLibraryFilename(@NotNull File library);  }