Fix outstanding issues with conversion to NIO
NIO methods throw NoSuchFileException, not FileNotFoundException. How nice. Throwing from Files#getLastModifiedTime, apart from cluttering up throws clauses, means callers have to check for FileNotFoundException, which is verbose and error prone. Instead, implement a helper with the old File#lastModified() semantics; this preserves old behavior, which might not handle some error cases well, but worked well enough. (In theory we could use FileSnapshot or something, but I don't want to shave that particular yak until/unless I get a chance to add a Path-compatible interface to FileSnapshot in JGit as well.) Organize some imports. Tested: -Tests pass. -Initialized a site, including downloading. -Launched a site. -Added and removed site headers and CSS in a running site. -Added and removed plugins, both live and while shutdown. Change-Id: I60dfe5280512f00dce4ec99fe3689b2f2b3c6685
This commit is contained in:
@@ -15,7 +15,6 @@
|
||||
package com.google.gerrit.pgm.init;
|
||||
|
||||
import static java.nio.charset.StandardCharsets.UTF_8;
|
||||
|
||||
import static org.easymock.EasyMock.createStrictMock;
|
||||
import static org.easymock.EasyMock.eq;
|
||||
import static org.easymock.EasyMock.expect;
|
||||
|
||||
Reference in New Issue
Block a user