title: renaming internal file name in zip file
body: <p>this is a follow up question to this discussion</p>
  
  <p><a href="https://stackoverflow.com/questions/28126450/renaming-file-name-inside-a-zip-file">renaming file name inside a zip file</a></p>
  
  <p>i used the suggestion given in the above post to rename the internal file name of a zip file. It works great in windows. When i take to Linux, as mentioned in the last comment, the rename happens only if the file is owned by the id running the java code. If i run the code as a "xxx" id and the file is owned by "yyy" the rename is not happening. This even if the file permission is 777. I tried to check if the sourcefile writable and it is. No idea why this would be the case. Please share your thoughts. thanks as always.</p>
  
  <pre><code>URI uri = URI.create("jar:file://"+ SourceDirName + "/" + 
  SourceFileName);
  FileSystem zipfs = FileSystems.newFileSystem(uri,       
  Collections.&lt;String,Object&gt;emptyMap())) { 
  Path sourceURI = zipfs.getPath("/"+ intFileName); 
  Path destinationURI = zipfs.getPath("/"+ ZipInternalName); 
  Files.move(sourceURI, destinationURI); 
  </code></pre>
  
  <p>intFileName is the zip internal file name
  ZipInternalName is the new name i want to use to rename the intFileName</p>
  
  <p>To check if the id that is running the code has write access to the SourceURI, i tried this</p>
  
  <pre><code>if (Files.isWritable(sourceURI)){
  System.out.println("true");
  }
  </code></pre>
  
  <p>and i got a true for writable but again rename doesnt work</p>
  
  <p>Also tried</p>
  
  <pre><code>Files.move(sourceURI, sourceURI.resolvesibling(destinationURI);
  </code></pre>
  
  <p>but no use</p>