@Test(expected = IOException.class) public void testAssertNotZipSlipVulnarableVulnerable2() throws IOException { Utilities.assertNotZipSlipVulnarable( new File("./target/../../testfile"), Paths.get("./target")); }
public static final void assertNotZipSlipVulnarable(File file, Path destinationDir) throws IOException { if (!file.toPath().normalize().startsWith(destinationDir)) { throw new IOException( String.format( "Bad zip entry: ZipSlip extracting %s to %s", file, destinationDir)); } }
Utilities { public static final void assertNotZipSlipVulnarable(File file, Path destinationDir) throws IOException { if (!file.toPath().normalize().startsWith(destinationDir)) { throw new IOException( String.format( "Bad zip entry: ZipSlip extracting %s to %s", file, destinationDir)); } } }
Utilities { public static final void assertNotZipSlipVulnarable(File file, Path destinationDir) throws IOException { if (!file.toPath().normalize().startsWith(destinationDir)) { throw new IOException( String.format( "Bad zip entry: ZipSlip extracting %s to %s", file, destinationDir)); } } private  Utilities(); }
Utilities { public static final void assertNotZipSlipVulnarable(File file, Path destinationDir) throws IOException { if (!file.toPath().normalize().startsWith(destinationDir)) { throw new IOException( String.format( "Bad zip entry: ZipSlip extracting %s to %s", file, destinationDir)); } } private  Utilities(); static boolean equals(boolean o1, boolean o2); static boolean equals(char o1, char o2); static boolean equals(byte o1, byte o2); static boolean equals(short o1, short o2); static boolean equals(int o1, int o2); static boolean equals(long o1, long o2); static boolean equals(float o1, float o2); static boolean equals(double o1, double o2); static boolean equals(final Object object1, final Object object2); static boolean deepEquals(final Object object1, final Object object2); static int hash(boolean value, int seed); static int hash(char value, int seed); static int hash(int value, int seed); static int hash(long value, int seed); static int hash(float value, int seed); static int hash(double value, int seed); static int hash(Object value, int seed); static int deepHashCode(final Object object); static String deepToString(final Object object); @SuppressWarnings("unchecked") static Queue<E> emptyQueue(); static String spaces(int length); static void ensureNonNull(final String name, final Object object); static void ensureArgumentNonNull(final String name, final Object object); static Stream<T> stream(Iterable<T> iterable); static Stream<T> stream(Iterator<T> iterator); static Stream<T> stream(Optional<T> optional); static Stream<Class<? extends U>> streamIfSubtype(
            Class<T> type, Class<U> supertype); static Collector<T, ?, Set<T>> toUnmodifiableSet(); static Collector<T, ?, Map<String, T>> toInstanceByClassNameMap(); static final void assertNotZipSlipVulnarable(File file, Path destinationDir); }
Utilities { public static final void assertNotZipSlipVulnarable(File file, Path destinationDir) throws IOException { if (!file.toPath().normalize().startsWith(destinationDir)) { throw new IOException( String.format( "Bad zip entry: ZipSlip extracting %s to %s", file, destinationDir)); } } private  Utilities(); static boolean equals(boolean o1, boolean o2); static boolean equals(char o1, char o2); static boolean equals(byte o1, byte o2); static boolean equals(short o1, short o2); static boolean equals(int o1, int o2); static boolean equals(long o1, long o2); static boolean equals(float o1, float o2); static boolean equals(double o1, double o2); static boolean equals(final Object object1, final Object object2); static boolean deepEquals(final Object object1, final Object object2); static int hash(boolean value, int seed); static int hash(char value, int seed); static int hash(int value, int seed); static int hash(long value, int seed); static int hash(float value, int seed); static int hash(double value, int seed); static int hash(Object value, int seed); static int deepHashCode(final Object object); static String deepToString(final Object object); @SuppressWarnings("unchecked") static Queue<E> emptyQueue(); static String spaces(int length); static void ensureNonNull(final String name, final Object object); static void ensureArgumentNonNull(final String name, final Object object); static Stream<T> stream(Iterable<T> iterable); static Stream<T> stream(Iterator<T> iterator); static Stream<T> stream(Optional<T> optional); static Stream<Class<? extends U>> streamIfSubtype(
            Class<T> type, Class<U> supertype); static Collector<T, ?, Set<T>> toUnmodifiableSet(); static Collector<T, ?, Map<String, T>> toInstanceByClassNameMap(); static final void assertNotZipSlipVulnarable(File file, Path destinationDir);  }