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

fix #10175: set FilesetEntry client path to String <256 chars #1706

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions components/blitz/src/ome/formats/importer/ImportContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,17 @@ public void fillData(ImportConfig config, ImportSettings settings, Fileset fs,
// Fill used paths
for (String usedFile : getUsedFiles()) {
final FilesetEntry entry = new FilesetEntryI();
final FsFile fsPath = sanitizer.getFsFileFromClientFile(new File(usedFile), Integer.MAX_VALUE);
entry.setClientPath(rstring(fsPath.toString()));
FsFile fsPath = sanitizer.getFsFileFromClientFile(new File(usedFile), Integer.MAX_VALUE);
String fsPathString;
while (true) {
fsPathString = fsPath.toString();
if (fsPathString.length() < 256) {
Copy link
Member

Choose a reason for hiding this comment

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

Should this be defined as a constant/property somewhere? Or is there no point since everything else is hard-coded?

Copy link
Member Author

Choose a reason for hiding this comment

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

I was hoping to figure out how to extract it from whatever's setting the VARCHAR(255) on that column in the first place, but I couldn't find it.

Copy link
Member

Choose a reason for hiding this comment

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

Fair enough.

break;
}
final List<String> components = fsPath.getComponents();
fsPath = new FsFile(components.subList(1, components.size()));
}
entry.setClientPath(rstring(fsPathString));
fs.addFilesetEntry(entry);
}

Expand Down