Comments (2)
No, it should not. Files.move(java.nio.file.Path, java.nio.file.Path, java.nio.file.CopyOption...)
By default, this method attempts to move the file to the target file, failing if the target file exists except if the source and target are the same file, in which case this method has no effect. …
And neither does the default file system provider. The following code does not throw an exception
Path path = Paths.get("/home/user/temp/afolder");
Files.move(path, path);
from memoryfilesystem.
sorry bad title.
Better would be: moving a dir to a subdirectory of itself should throw, e.g.
Path path = filesystem.getPath("/home/user/temp/afolder");
Path sub = path.resolve( "a-kid");
Files.move(path, sub); // should throw
from memoryfilesystem.
Related Issues (20)
- Implement FileSystemProvider#deleteIfExists
- Removing all FilePermissions leaves the file still read and writeable HOT 3
- Implement JUnit extension for @CompatibilityTest
- MemoryFileSystem::newOutputFileStream does not check the path it opens for write permissions HOT 4
- Is it possible to use MemoryFileSystem as the default FileSystem? HOT 3
- Support Jakarta EE
- Path.touri().getPath() returns null HOT 7
- Support URLs HOT 6
- Module descriptor or module name seems to have gone away HOT 4
- Verify MemoryInode.writeFully handles overflow
- Infinite loop on #transferFrom underflow
- Consider introducing a Flags abstraction
- Validate invalid open options combinations
- Implement header support for URLConnection
- Files.setPosixFilePermissions throws UnsupportedOperationException HOT 3
- Relative paths in symlinks not correctly resolved
- newInputStream and newOutputStream are not atomic
- macOS paths no longer normalised to NFD
- Solution or workaround for nested zip/jar files? HOT 2
- Wrong index referenced in exception message for subpath HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from memoryfilesystem.