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

[274] Corrected javadoc for Part.write(String) #276

Merged
merged 1 commit into from
Dec 11, 2019

Conversation

janbartel
Copy link
Contributor

Fix for #274

The javadoc for Part.write(String) contained the contradictory sentence: "Absolute paths are used as provided and are relative to getLocation()."
Changed to the agreed text: "Relative paths are relative to MultipartConfigElement.getLocation(). Absolute paths are used as provided."

The javadoc for Part.write(String) contained the
contradictory sentence: "Absolute paths are used
as provided and are relative to <code>getLocation()</code>."
Changed to the agreed text: "Relative paths are relative
to MultipartConfigElement.getLocation(). Absolute paths
are used as provided."

Signed-off-by: Jan Bartel <[email protected]>
@joakime
Copy link

joakime commented Aug 5, 2020

What is a "relative path" in this?

If I'm running on Microsoft Windows.
And the Multipart location is D:\web\multipart and the offered String is Part.write("/foo.dat");, then what?

The /foo.dat is not an absolute path on Windows, as that would result in D:\foo.dat. (which is relative to the root D:\)

The test of what is a "relative path" should be based on what?
The provided argument?
The provided argument and the multipart filesystem type? (what if you are on a system with multiple filesystem active?)
This needs to be fixed to be extra clear on what "relative path" means.

If the deployment is on a Virtual File System then relative path is again vague.
What if the deployment on a java.nio.file.FileSystem that has multiple roots?

@gregw
Copy link
Contributor

gregw commented Aug 5, 2020

@joakime a "relative path" is not an "absolute path". An "absolute path" is described by the javadoc as system dependent, so I by extension, relative paths are also system dependent. So to determine what is a relative path then APIs like FileSystems.getDefault().getPath(String) need to be used to determine that in a system dependent way.

The issue here is that this API should never been created to allow either a filename or a path, as the moment that is allowed things become very system dependent.

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.

4 participants