reactivex / rxjavafileutils Goto Github PK
View Code? Open in Web Editor NEWFile utilities with RxJava
License: Apache License 2.0
File utilities with RxJava
License: Apache License 2.0
Hi, we're looking at this library to see whether it will be useful in one of our projects. A first question is whether this library is still maintained and whether people are using it, especially given that it is not that active in commits...
Since this repo does not have much documentation, we're left to figuring out how the API works and what it all does by looking at the code, unit test (single) and just experimenting (which is actually the way I prefer to do things). We're looking at a couple of scenario's right now that sparked some curiosity and raised some questions. These mainly have to do with the events that are being produces by the Observable
and their differences between Mac and Windows systems.
(You can find the code for the file system monitor here)
Scenario 1: If a file exists on startup and gets changed after startup
On Mac we get a CREATE event for both the folder and the file (both with absolute path), followed by a DELETE of the file with a relative path, even though it still exists
On Windows we get only a MODIFY event, however, it contains an invalid path: if we watch the directory <project-base-dir>/target/test/FileUtils/
containing a file hello.txt
, the path we get is <project-base-dir>/hello.txt
. This happens in all following scenarios on Windows as well!
Scenario 2: Scenario 1 followed by another change
On Mac will add a MODIFY event for both the folder and file
On Windows will add a MODIFY event for only the file
Scenario 3: Deleting a file
On Mac will cause a MODIFY on the folder and a DELETE on the file (the latter with a relative path)
On Windows will cause a DELETE on the file alone
Scenario 4: Copy pasting a large file (3,28GB) into the monitored folder
On Mac gives a CREATE on both folder and file, immediately followed by a MODIFY on the file
On Windows gives a CREATE on the file alone, immediately followed by a MODIFY on the file and another MODIFY on the file as soon as the copy-paste has finished
Scenario 5: (only tested on Windows) writing in a file and saving it
On Windows gives inconsistently one or two MODIFY events on the file
Are we missing something here, or are these real bugs. If so, are these already known (can't find any issues on that in this repository) and are they related to either this library or the underlying java.nio.*
package?
Curious to see if there are any projects that use this library and how they deal with these scenarios!
At the moment the API is Map<Path, Kind[]> -> Observable<WatchEvent<?>>
and Path -> Kind[] -> Observable<WatchEvent<?>>
. This seem too literal of an interpretation of the underlying API.
The first problem that I have is that notification that events were dropped (WatchEvent<Object>
) and changes (WatchEvent<Path>
) means that the Observable has to have a wild card type. I would like to see the API have a stronger type definition. Two ideas that i've had are:
Observable<WatchEvent<Path>>
and the other of Observable<Void>
Observable<Either<WatchEvent<Path>,Void>>
The second is that I'm not sure why there is a method that takes Map<Path, Kind[]>
couldn't that be done externally as the flatMap of individual Path -> Kind[] -> Observable<WatchEvent<Path>>
.
Hi guys,
I could not find anything for "rxjava-file-utils" on maven central. The documentation tells me, there should be something...
Could you double check this?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.