SecureDS.java revision 2362
733a5356058ae0150a67d61f0ad8e5260d2acae3rb * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
733a5356058ae0150a67d61f0ad8e5260d2acae3rb * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
733a5356058ae0150a67d61f0ad8e5260d2acae3rb * This code is free software; you can redistribute it and/or modify it
733a5356058ae0150a67d61f0ad8e5260d2acae3rb * under the terms of the GNU General Public License version 2 only, as
733a5356058ae0150a67d61f0ad8e5260d2acae3rb * published by the Free Software Foundation.
733a5356058ae0150a67d61f0ad8e5260d2acae3rb * This code is distributed in the hope that it will be useful, but WITHOUT
733a5356058ae0150a67d61f0ad8e5260d2acae3rb * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
733a5356058ae0150a67d61f0ad8e5260d2acae3rb * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
733a5356058ae0150a67d61f0ad8e5260d2acae3rb * version 2 for more details (a copy is included in the LICENSE file that
733a5356058ae0150a67d61f0ad8e5260d2acae3rb * accompanied this code).
733a5356058ae0150a67d61f0ad8e5260d2acae3rb * You should have received a copy of the GNU General Public License version
733a5356058ae0150a67d61f0ad8e5260d2acae3rb * 2 along with this work; if not, write to the Free Software Foundation,
733a5356058ae0150a67d61f0ad8e5260d2acae3rb * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
733a5356058ae0150a67d61f0ad8e5260d2acae3rb * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
733a5356058ae0150a67d61f0ad8e5260d2acae3rb * or visit www.oracle.com if you need additional information or have any
733a5356058ae0150a67d61f0ad8e5260d2acae3rb * questions.
733a5356058ae0150a67d61f0ad8e5260d2acae3rb * @bug 4313887 6838333
733a5356058ae0150a67d61f0ad8e5260d2acae3rb * @summary Unit test for java.nio.file.SecureDirectoryStream
733a5356058ae0150a67d61f0ad8e5260d2acae3rb * @library ..
public class SecureDS {
static boolean supportsLinks;
if (supportsLinks)
if (supportsLinks)
.isDirectory());
.isRegularFile());
.isRegularFile());
.isDirectory());
.isDirectory());
if (supportsLinks) {
.isRegularFile());
.isSymbolicLink());
.isDirectory());
.isSymbolicLink());
if (supportsLinks) {
} catch (IOException x) { }
if (supportsLinks) {
.close();
} catch (IOException x) { }
if (supportsLinks) {
removed++;
if (supportsLinks)
if (supportsLinks) {
.isSymbolicLink());
} catch (AtomicMoveNotSupportedException x) { }
} catch (NullPointerException x) { }
} catch (NullPointerException x) { }
} catch (NullPointerException x) { }
} catch (NullPointerException x) { }
} catch (NullPointerException x) { }
} catch (NullPointerException x) { }
} catch (NullPointerException x) { }
} catch (NullPointerException x) { }
} catch (NullPointerException x) { }
} catch (NullPointerException x) { }
} catch (NullPointerException x) { }
} catch (NullPointerException x) { }
} catch (ClosedDirectoryStreamException x) { }
} catch (ClosedDirectoryStreamException x) { }
} catch (ClosedDirectoryStreamException x) { }
} catch (ClosedDirectoryStreamException x) { }
static void assertTrue(boolean b) {
static void shouldNotGetHere() {
assertTrue(false);