« first day (4 days earlier)    last day (15 days later) » 

1:57 PM
@fge I am home now
 
fge
Hello ;)
 
Hi
So, this is MorePaths.java: hastebin.com/xuxamefuru.avrasm
 
fge
By the way, do a pull --rebase, there have been a few commits
Nothing major
 
and this is MorePathsTest.java: hastebin.com/sezameweho.avrasm
Okay
 
fge
Hmm, the code is quite complicated
Why don't you just for (final Path root: path1) { /* process root here */ }?
Err
 
2:03 PM
I know test is still under development
I just wanted to show you what I am doing :D
 
fge
final Iterable<Path> roots = path1.getFileSystems().getRootDirectories(); for (final Path root: roots) etc
Also, .getRootDirectories() can never be null
 
Yep, removed that check
 
fge
And you don't need to create the iterator either -- you do know what Iterable really means, right?
 
@fge Objects to iterate on
?
 
^^
 
2:09 PM
Hey @Uni :D
 
Hello :D I'm just watching you people work, while participating in a chess tournament :)
// developers in winter
wait...
Why is this room ID 66667?!
AAAAAH!!!
 
@Unihedro Sure that's great
 
"Iterable" means you can use it with enhanced for loops (and hence .forEach), so for (final Path root : path1.getFileSystems().getRootDirectories()) will work
 
@fge Should we compare the path2Root with this list now? (We can do list.contains(path2Root) ) ?
@Unihedro On lichess or gameknot?
 
fge
@Mr.777 hold on
@Mr.777 no, you'll have to do that in a loop -- .getRootDirectories() returns an Iterable, not a List
 
2:16 PM
@fge But I am adding it to a List<String> :D
 
fge
You should not have to
You are doing the work twice
Don't create a list, just iterate and use a boolean to tell whether you have found a candidate
If it is false then you bail out
(ie, you throw)
(I said throw, not throw up, OK? :) )
 
Okay sure :D
`Iterable<Path> roots = path1.getFileSystem().getRootDirectories();

for(final Path root: roots) {
if(root.toString().equals(p2Root)) {// I think we should use equalsIgnoreCase() ?
// Do something
}
}`
 
fge
No, don't .equalsIgnoreCase()
 
Use == for stunt coding
 
:D
So, if I find, I return root of either path otherwise null?
 
fge
2:22 PM
@Mr.777 if you find no matching root, throw an exception
An UnresolvablePathException
As for the message, let me think for a second
"root of resolved path is incompatible with source path"
There
"root of path to resolve", rather
@Unihedro want to code too? ;)
 
@fge But... it's Winter! :D
 
MorePaths.java: http://hastebin.com/idirebuyeq.php

MorePathsTest.java: http://hastebin.com/iqosukitej.avrasm
 
fge
For MorePathsTest: you have a mock iterator lying around
 
Difference between Iterable & Iterator: Iterable is stateless while iterator has state
 
fge
Ah, also, I added a CustomAssertions class which defines shouldNotThrow()
 
2:31 PM
@fge Yes, I am sorry for that.
 
fge
You can use that instead of failBecauseExceptionWasNotThrown()
(actually I made the proposal to the assertj guys and it's going to make it in)
 
Wow awesome
Ops seems like I will have to merge master with the branch?
 
fge
Didn't you pull --rebase?
 
I just synced master
 
fge
OK, committed yet?
Wait before you do
(if you haven't)
 
2:33 PM
No, I didn't
 
fge
OK, so at the command line: git stash; git rebase upstream/master; git stash pop
(this supposes my remote is called upstream here)
 
Yes, it's upstream
Where can I find CustomAssertions?
Can't find any, in the code
 
fge
Eh?
Hmm
Yes, it is there normally
In src/test/java/com/github/fge/filesystem/
If this is not the case then you haven't rebased yet
Or you haven't fetched
 
I did: git stash;git rebase upstream/master;git stash pop;
Although, I can see new package, testfs under src/test/java/com/github/fge/filesystem
 
fge
Yes, this is normal
This is for @ItachiUchiha's work
And you should see CustomAssertions now, right?
 
2:43 PM
No, I still can't
 
fge
What?
Uh
Even at the command line?
 
Also for MemoryfsExample.java, there are compile time errors
Can not resolve symbol MemoryFileSystemBuilder
 
fge
Oh, sh*, I know why
It is in another package
Hmm, you haven't refreshed dependencies
I would have thought Eclipse would do that automatically
 
I am using idea
:D
 
fge
OK well, you should have a gradle "window" on the left
Show it and click on the reload button
 
2:48 PM
Okay that is done
What about CustomAssertions?
 
fge
I'll add it in
Hold on a minute
 
Okay
 
fge
First commit what you have done so far
 
Well, I don't want to commit with compilation errors in it
 
fge
If you have refreshed the dependencies it should not fail to compile anymore
 
2:53 PM
I am using this shouldNotThrow() and right now there are compilation errors, so still want me to?
No, that has been resolved now
 
fge
What compilation errors?
 
Talking about shouldNotThrow() CustomAssertions
 
fge
Have you imported it?
It's a static method
 
This method belongs to CustomAssertions class which you have written, right?
 
fge
Yes
 
2:58 PM
Yes, so I can not find CustomAssertions class
 
fge
Uh
 
Let me rebase
 
fge
Ah, I thought you rebased already
 
You asked me to hold on :D
One question. Right now i do this to commit:

git commit -m MESSAGE HERE
But what I want to do, is it possible to open an editor so that I could format my message etc?
 
fge
Sure, just type git commit
This will open an editor
(I never use git commit -m :p)
 
3:04 PM
Great and how can I add files without doing git add NAMEOFFILEWITHWHOLEPATH1, NAMEOFFILEWITHWHOLEPATH2 ...... (I mean is there any easy way)?
 
fge
git add thedirectory -- that will include all modifications to the directory into the index
If you also want to record deletions, use git add -A
brb
 
@Uni
hint: Updates were rejected because the tip of your current branch is behind
This error is happening while I try to push changes
 
lol
 
I lost!
 
3:13 PM
Because you couldn't move with in 30 secs :D
Alright I am going for dinner, be back in 15 mins
 
Bye!
 
3:25 PM
Back
@fge Sent you PR
 
fge
OK, looking
(that was some quick dinner)
 
Yep
:D
 
fge
OK, I'll pull and modify a little
 
Okay
 
fge
3:45 PM
OK, pull
 
Did :D
Aww, now I am using idea :(
Still tabs? :O
 
fge
Yep
But not from you
 
Shouldn't we break, once we find the match?
Okay can you give me your project settings file so that I could import the same settings?
 
fge
We could break but what for? It's not like we have bazillion roots anyway
 
Okay
 
fge
3:49 PM
Argh, sh*
Need to go for 5 mn
 
Okay
 
fge
So, now, in the main method, we know that path2 is absolute an "well formed"
All that is left is to build the resulting path
And for this we are going to use the filesystem of path1 which we extracted earlier
The method we will use is .getPath()
First, we inject the root of path2 (which we also have)
Then we inject each of its elements as strings
Its elements are what is returned by the builtin Iterable of Path
It iterates over all name elements -- that is, it does not include the root
So, we create a result Path (we will call it result, how original) whose value is, to start with, fs1.getPath("root")
Then we cycle through path2 and do result = result.resolve(element.toString())
ANd we return result
 
By cycle through you mean path.getFileSystem().getRootDirectories() ?
 
fge
No, over path2 directly
Path implements Iterable<Path>
 
Okay
 
fge
4:04 PM
Note that when we do this there will still be a possible error, but this is beyond our control so we won't test for it ;)
 
All implementation should be inside same resolve function?
 
fge
Of what?
 
?
Building resulting path
 
fge
OK, here's the code: Path result = fs1.getPath(path2Root); for (final Path element: path2) result = result.resolve(element.toString()); return result;
 
lol, I just asked it should be implemented inside resolve() , right?
Also, can you please share your IDEA settings with me?
 
fge
4:08 PM
Ah
Well, yes
As to my IDEA settings, uh, I don't know which files to send, really ;)
 
fge
Yep, that's it ;)
 
PR?
 
fge
However, testing that will be a little difficult
Not yet, let me think about the test
 
Okay I am thinking too
I don't know what you are thinking but I am thinking about result.resolve(element.toString())
 
fge
4:15 PM
Yes, but I think we are going to do something more simple than that
We are going to use memoryfs ;)
 
Memory FS actually mocks the file system?
 
fge
It is a FileSystem implementation
Just like I made a FileSystem over FTP, Dropbox and Box.com ;)
 
Oh wow
Why don't we use ones you developed?
 
fge
Because for locally testing stuff like that, a memory filesystem is much more convenient ;)
We operate at the user level API here, not filesystem development
 
Okay
Welcome @Ita
 
4:27 PM
@Mr.777 heya
 
fge
Argh, I just thought about something
Wait, I need to check
Argh, f*
I'm going to need to add a second dependency, otherwise the test I have in mind will only work on Unix-like systems
brb in 5 mn
OK, you need to pull --rebase
 
4:52 PM
Done sir
 
fge
Argh, noooo
I need to go again
 
fge
This time for 40 minutes :(
 
lol
hahahah
 
fge
Anyway, you two learn how to create paths etc
 
4:54 PM
before you go , can you tell what to do? or read?
 
fge
Look at the memoryfs example and play ;)
 
Okay perfecto
 
fge
Sorry :-(
 
5:20 PM
Gonna make it an early night tonight. Good night.
 
fge
5:46 PM
Back
Ah
Well, to the other room, then? ;)
 
Instead of having so many semi-private rooms why not "fge's lab"? :P
 
fge
Uhwell, why not I guess
I don't know how to create a room, however
OK, choosing a name for "my" room

fge's java.nio.file corner

No java.io.file in here! java7fs.wikia.com (go there with an a...
Here ;)
I'll leave this one -- bye bye :p
 

« first day (4 days earlier)    last day (15 days later) »