Demo.java revision 2830
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. 2830N/A * java [-cp .../zipfs.jar:./] Demo action ZipfileName [...] 2830N/A * To deploy the provider, either copy the zipfs.jar into JDK/JRE 2830N/A * extensions directory or add 2830N/A * into your class path as showed above. 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 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 2830N/A //sf1.getPath(args[3]).moveTo(fs2.getPath(args[3])); 2830N/A //sf1.getPath(args[3]).copyTo(fs2.getPath(args[3])); 2830N/A //System.out.println(fstore.getFileStoreAttributeView(FileStoreSpaceAttributeView.class) 2830N/A //System.out.println("copying..." + path); 2830N/A // check the content of two paths are equal 2830N/A //System.out.printf("checking <%s> vs <%s>...%n", 2830N/A // src.toString(), dst.toString());