-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Datasources - part 3: TarArchiveDataSource #3103
Conversation
baseName, null, null, null); | ||
} | ||
|
||
public TarArchiveDataSource(Path tarFile) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use private constructor with a FileInformation argument to avoid calling 3 times ?
TarArchiveInputStream tar = new TarArchiveInputStream(cis)) { | ||
ArchiveEntry entry; | ||
while ((entry = tar.getNextEntry()) != null) { | ||
// Consider only files located at the root of the archive |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe as a first version do the same as zip ? only filter on the matcher. (in the zip code the comment is wrong). Then in a separate PR we can decide if we implement this behavior for both ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
powsybl-core/commons/src/main/java/com/powsybl/commons/datasource/ZipFileDataSource.java
Line 212 in feeb6bc
// Consider only files in the given folder, do not go into folders |
but
powsybl-core/commons/src/main/java/com/powsybl/commons/datasource/ZipFileDataSource.java
Line 222 in feeb6bc
if (!zipEntry.isDirectory() && p.matcher(zipEntry.getName()).matches()) { |
Signed-off-by: Nicolas Rol <nicolas.rol@rte-france.com>
Signed-off-by: Nicolas Rol <nicolas.rol@rte-france.com>
Signed-off-by: Nicolas Rol <nicolas.rol@rte-france.com>
Signed-off-by: Nicolas Rol <nicolas.rol@rte-france.com>
Signed-off-by: Nicolas Rol <nicolas.rol@rte-france.com>
Signed-off-by: Nicolas Rol <nicolas.rol@rte-france.com>
47bf1a7
to
2a4ba27
Compare
commons/src/main/java/com/powsybl/commons/datasource/FileInformation.java
Outdated
Show resolved
Hide resolved
commons/src/main/java/com/powsybl/commons/datasource/TarArchiveDataSource.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Florian Dupuy <florian.dupuy@rte-france.com>
Signed-off-by: Nicolas Rol <nicolas.rol@rte-france.com>
Signed-off-by: Nicolas Rol <nicolas.rol@rte-france.com>
commons/src/main/java/com/powsybl/commons/datasource/TarArchiveDataSource.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Nicolas Rol <nicolas.rol@rte-france.com>
Quality Gate passedIssues Measures |
* add TarArchiveDataSource * add unit test * make tar work like zip in listFiles * change test to show that files in every subfolder is reached Signed-off-by: Nicolas Rol <nicolas.rol@rte-france.com>
Please check if the PR fulfills these requirements
Does this PR already have an issue describing the problem?
No
What kind of change does this PR introduce?
Feature
What is the current behavior?
Tar files cannot be used
What is the new behavior (if this is a feature change)?
Tar files can now be used as datasource
Does this PR introduce a breaking change or deprecate an API?
If yes, please check if the following requirements are fulfilled
What changes might users need to make in their application due to this PR? (migration steps)
Other information: