Skip to content
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

Merged
merged 12 commits into from
Aug 2, 2024

Conversation

rolnico
Copy link
Member

@rolnico rolnico commented Jul 17, 2024

Please check if the PR fulfills these requirements

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

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?

  • Yes
  • No

If yes, please check if the following requirements are fulfilled

  • The Breaking Change or Deprecated label has been added
  • The migration steps are described in the following section

What changes might users need to make in their application due to this PR? (migration steps)

Other information:

@rolnico rolnico self-assigned this Jul 17, 2024
@rolnico rolnico changed the base branch from main to nro/datasources_2_main_extension July 17, 2024 12:11
baseName, null, null, null);
}

public TarArchiveDataSource(Path tarFile) {
Copy link
Contributor

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
Copy link
Contributor

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 ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// Consider only files in the given folder, do not go into folders

but

if (!zipEntry.isDirectory() && p.matcher(zipEntry.getName()).matches()) {

Base automatically changed from nro/datasources_2_main_extension to main August 1, 2024 14:39
rolnico added 8 commits August 1, 2024 16:42
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>
Signed-off-by: Nicolas Rol <nicolas.rol@rte-france.com>
Signed-off-by: Nicolas Rol <nicolas.rol@rte-france.com>
@flo-dup flo-dup force-pushed the nro/datasources_3_new_features branch from 47bf1a7 to 2a4ba27 Compare August 1, 2024 14:43
flo-dup and others added 3 commits August 1, 2024 17:07
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>
Signed-off-by: Nicolas Rol <nicolas.rol@rte-france.com>
Copy link

sonarqubecloud bot commented Aug 2, 2024

@flo-dup flo-dup merged commit 4446bd9 into main Aug 2, 2024
7 checks passed
@flo-dup flo-dup deleted the nro/datasources_3_new_features branch August 2, 2024 15:11
@flo-dup flo-dup mentioned this pull request Aug 9, 2024
7 tasks
geofjamg pushed a commit that referenced this pull request Sep 18, 2024
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants