Skip to content
This repository has been archived by the owner on Feb 5, 2018. It is now read-only.

Unknown exception being thrown in Tar.tarListDir() #15

Open
dgets opened this issue Dec 6, 2017 · 1 comment
Open

Unknown exception being thrown in Tar.tarListDir() #15

dgets opened this issue Dec 6, 2017 · 1 comment
Assignees
Labels
Milestone

Comments

@dgets
Copy link
Owner

dgets commented Dec 6, 2017

No idea where this exception with a null message is coming from right now, but it is tracked to this method, at least. I've got a feeling that the StackExchange post on reading a tar directory here may well come in useful. There's probably way too much superfluous code in my method that seemed necessary, as I was stumbling through the apache libraries at first.

@dgets dgets added the bug label Dec 6, 2017
@dgets dgets added this to the alpha milestone Dec 6, 2017
@dgets dgets self-assigned this Dec 6, 2017
@dgets dgets closed this as completed in c31e199 Dec 7, 2017
@dgets
Copy link
Owner Author

dgets commented Dec 11, 2017

Okay, I'm going to reopen this. I've got a feeling that the following error message that I've been getting (on any archive, whether or not it reads any of the archive data before throwing the exception or not) is the same issue rearing its head again. Error message follows:

Borkage: Issue in getRawList()'s call to Tar.tarListDir():
Closed w/exception: Stream Closed

As you can see, the relevant code is now stripped down quite a bit, with the bulky majority of it being my own hack debugging code. Really got to keep working on those unit tests. Here's the method that's throwing the exception right now, though:

               try {
			while ((entry = tarInput.getNextTarEntry()) != null) {
				ouah.add(entry.getName());
				
				if (RecScan.verbose || RecScan.debugging) {
					if (entry.isFile()) {
						System.out.print("file: \t");
					} else if (entry.isDirectory()) {
						System.out.print("dir: \t");
					} else {
						System.out.print("wut: \t");
					}
					
					System.out.println(ouah.get(ouah.size() - 1));
				}
				
				//ouah.add(entry.getName());
			}
		} catch (Exception e) {
			tarInput.close();
			throw new Exception("Closed w/exception: " + e.getMessage());
		}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant