Skip to content

Commit

Permalink
Issue #1337 - MultiPartFormInputStream path resolution fix
Browse files Browse the repository at this point in the history
+ We cannot determine if a String represents
  an absolute or relative path simply by
  using the String itself.
  We must use a Path and resolve against it,
  allowing the runtime JVM, its OS, its
  FileSystems, and its FileStore implementations
  to make that call.
  We do this by using a resolved java.nio.file.Path
  and asking it to resolve a new path from a
  provided String.
  This satisfies the FileStore and FileSystem
  requirements, and in the end pushes the
  call on what is relative or absolute on the
  FileSystem implementation.
+ Switched entirely to Path from File as it
  improves behaviors on all runtime JVMs
+ Using FileStore for permissions changing
  as File.setReadable() is broken on Windows.
+ Moved _location calculation to Constructor.
+ Eliminated .deleteOnExit() as it doesn't work
  on Windows (at all) and is only performed
  at Runtime exit on OSX.

Signed-off-by: Joakim Erdfelt <[email protected]>
  • Loading branch information
joakime committed Aug 6, 2020
1 parent 00f198f commit 388eb13
Showing 1 changed file with 175 additions and 74 deletions.
Loading

0 comments on commit 388eb13

Please sign in to comment.