2830N/A * Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved. 2830N/A * Redistribution and use in source and binary forms, with or without 2830N/A * modification, are permitted provided that the following conditions 2830N/A * - Redistributions of source code must retain the above copyright 2830N/A * notice, this list of conditions and the following disclaimer. 2830N/A * - Redistributions in binary form must reproduce the above copyright 2830N/A * notice, this list of conditions and the following disclaimer in the 2830N/A * documentation and/or other materials provided with the distribution. 2830N/A * - Neither the name of Oracle nor the names of its 2830N/A * contributors may be used to endorse or promote products derived 2830N/A * from this software without specific prior written permission. 2830N/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 2830N/A * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 2830N/A * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 2830N/A * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 2830N/A * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 2830N/A * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 2830N/A * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 2830N/A * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 2830N/A * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 2830N/A * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 2830N/A * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 4378N/A * This source code is provided to illustrate the usage of a given feature 4378N/A * or technique and has been deliberately simplified. Additional steps 4378N/A * required for a production-quality application, such as security checks, 4378N/A * input validation and proper error handling, might not be present in 3216N/A * java Demo action ZipfileName [...] 2830N/A // rename entry src to dst inside zipfile 2830N/A // move an external src file into zipfile 2830N/A // move a zipfile entry src out to dst 2830N/A // copy entry src to dst inside zipfile 2830N/A // copy an external src file into zipfile 3060N/A // copy an external src file into zipfile 3060N/A // as entry dst, with attributes (timestamp) 2830N/A // copy zipfile entry src" out to file dst 2830N/A // copy path from zipfile zfsrc to zipfile 2830N/A // printout the attributes of entry path 2830N/A // printout the storespace attrs of entry path 2830N/A // set the lastModifiedTime of entry path 2830N/A // recursively list all entries of dir 2830N/A // list with buildDirTree=true 2830N/A // recursively verbose list all entries of 2830N/A // recursively walk all entries of dir 2830N/A // walk with buildDirTree=true 2830N/A add,
// <java Demo add zipfile file [...]> 2830N/A // create a new zipfile if it doesn't exit 2830N/A // and then add the file(s) into it. 2830N/A // test different ways to print attrs 3060N/A //list(fs.getPath("/"), true); 4123N/A * Not used in demo, but included for demonstrational purposes. 4123N/A * Not used in demo, but included for demonstrational purposes. 2830N/A //System.out.println("copying..." + path); 4123N/A * Not used in demo, but included for demonstrational purposes. 4123N/A * Checks that the content of two paths are equal. 4123N/A * Not used in demo, but included for demonstrational purposes. 2830N/A //System.out.printf("checking <%s> vs <%s>...%n", 2830N/A // src.toString(), dst.toString());