JarEntryTime.java revision 2662
2362N/A * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 0N/A * published by the Free Software Foundation. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 0N/A * @summary Check extracted files have date as per those in the .jar file 0N/A "-J-Dsun.tools.jar.useExtractionTime=true",
0N/A // Remove any leftovers from prior run 0N/A /* Create a directory structure 0N/A * Set the lastModified dates so that outer is created now, inner 2662N/A // Get the "now" from the "last-modified-time" of the last file we 2662N/A // just created, instead of the "System.currentTimeMillis()", to 2662N/A // workaround the possible "time difference" due to nfs. 2662N/A // ZipEntry's mod date has 2 seconds precision: give extra time to 0N/A // Make a jar file from that directory structure 0N/A // Extract and check that the last modified values are those specified 0N/A // Extract and check the last modified values are the current times. 0N/A // See sun.tools.jar.Main 0N/A //--------------------- Infrastructure --------------------------- 0N/A else fail(x +
" not equal to " + y);}