[ https://issues.apache.org/jira/browse/LUCENE-2339?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12848376#action_12848376 ]
Shai Erera commented on LUCENE-2339: ------------------------------------ Patch looks good! Few comments: # is it safe to use NIO for all FSDirs? I thought that on Windows NIO has some bugs/limitations. In that case, would it be safer if just NIOFSDir used NIO? # Can copyTo(Directory, Collection<String>) be changed to copyTo(Directory, Iterable<String>)? Unless we think that someone would want to use size() or something. # I know it's a matter of style, but you "import static Arrays.asList", and then use asList directly in copyTo(Dir). It confuses me because I expect asList to be a method declared on Dir, and so I prefer to see Arrays.asList. But it's just style, don't know how others feel about that. # On copyTo(Dir), perhaps instead of converting the listAll() to List and then remove elements from it, you can just iterate on whatever listAll() returns and add the files that pass the filter to a list? You can even optimize and if all the files Dir returned pass the filter, you can just pass the array to copyTo(Dir, Iterable), assuming we change the method to accept Iterable. But that's a minor optimization. # copy(src, dest, boolean) - can you add a message to @deprecated so users will know what to replace it with more easily? # I see that copy(src, dest) also accepts a boolean of whether to close the src directory. But copyTo(dIr) doesn't. I personally think it's ok, as someone can call close on src himself, but am wondering if it wouldn't be more convenient. I.e. instead of change calls from Directory.copy(src, dest, true), I now need to do src.copyTo(dest) followed by a src.close(). # closeSafely - perhaps print the stacktrace, even if you don't throw it? > Allow Directory.copy() to accept a collection of file names to be copied > ------------------------------------------------------------------------ > > Key: LUCENE-2339 > URL: https://issues.apache.org/jira/browse/LUCENE-2339 > Project: Lucene - Java > Issue Type: Improvement > Reporter: Earwin Burrfoot > Assignee: Michael McCandless > Attachments: LUCENE-2339.patch, LUCENE-2339.patch > > > Par example, I want to copy files pertaining to a certain commit, and not > everything there is in a Directory. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: java-dev-unsubscr...@lucene.apache.org For additional commands, e-mail: java-dev-h...@lucene.apache.org