Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7516441
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T01:07:59+00:00 2026-05-30T01:07:59+00:00

As a follow-up to Convert .tar.gz file to .zip using TrueZip? how does one

  • 0

As a follow-up to Convert .tar.gz file to .zip using TrueZip? how does one copy the contents of one compressed file into another using TrueZip? When I invoke:

TPath sourceFile = new TPath("c:/foo.zip");
TPath targetFile = new TPath("c:/bar.jar");
Files.copy(sourceFile, targetFile, StandardCopyOption.COPY_ATTRIBUTES);

I get:

java.io.FileNotFoundException: C:\foo.zip (expected FILE - is DIRECTORY)
    at de.schlichtherle.truezip.nio.file.TFileSystemProvider.copy(TFileSystemProvider.java:397)
    at de.schlichtherle.truezip.nio.file.TFileSystemProvider.copy(TFileSystemProvider.java:364)
    at java.nio.file.Files.copy(Files.java:1219)

The thing is, I know for a fact that c:/foo.zip is an existing file, not a directory.

  1. Why am I getting this error?
  2. How am I supposed to convert a ZIP file to a JAR file using TPaths?
  3. Does TPath require unmounting like TFile does?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T01:08:01+00:00Added an answer on May 30, 2026 at 1:08 am

    Answering my own question… Please note I figured this out by trial and error so I could be wrong on some of the points:

    1. Archives are treated as directories. Files.copy(archive, archive) is essentially trying to copy one directory to another. Files.copy(Path, Path) is made for copying a single file, not for copying directories recursively.

    2. Now that we know archives are treated as directories we simply copy files from one directory into another:

    Files.walkFileTree(sourceFile, new SimpleFileVisitor<Path>()
    {
        @Override
        public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException
        {
            Files.copy(file, targetFile.resolve(sourceFile.relativize(file)), 
                StandardCopyOption.COPY_ATTRIBUTES);
            return super.visitFile(file, attrs);
        }
    });
    

    3. Yes, you can use: targetFile.getFileSystem().sync(FsSyncOptions.UMOUNT);

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We are using sp's to convert a uploaded file into corresponding master values and
This a follow-up question to this one . Now I would like to convert
Right now I'm converting my datetime using CONVERT(CHAR(10), date, 107) which outputs as follow
I am carefully treading into WCF attempting to follow tutorials and convert my ASMX
Follow up question from Multi-core usage, threads, thread-pools . Are threads moved from one
I follow your suggests by now I have another problem. ifndef MARKERCONTAINE_H define MARKERCONTAINE_H
Follow-up to post: Using * Width & Precision Specifiers With boost::format I'm trying to
Possible Duplicate: How can I convert my java program to an .exe file ?
I've been trying to follow this example and using the reference to guide me,
I want to convert the follow string to date: 2004-09-30 23:53:48,140000000 I tried: to_date('#',

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.