Changes from review
This commit is contained in:
parent
c122c99163
commit
1cd0ac4959
|
@ -181,16 +181,16 @@ public abstract class Resource
|
|||
* Equivalent to {@link Files#getLastModifiedTime(Path, LinkOption...)} with the following parameter:
|
||||
* {@link #getPath()} then returning {@link FileTime#toInstant()}.
|
||||
*
|
||||
* @return the last modified time instant, or null if resource doesn't exist or doesn't have a last modified time.
|
||||
* @return the last modified time instant, or {@link Instant#EPOCH} if unable to obtain last modified.
|
||||
*/
|
||||
public Instant lastModified()
|
||||
{
|
||||
Path path = getPath();
|
||||
if (path == null)
|
||||
return null;
|
||||
return Instant.EPOCH;
|
||||
|
||||
if (!Files.exists(path))
|
||||
return null;
|
||||
return Instant.EPOCH;
|
||||
|
||||
try
|
||||
{
|
||||
|
@ -200,7 +200,7 @@ public abstract class Resource
|
|||
catch (IOException e)
|
||||
{
|
||||
LOG.trace("IGNORED", e);
|
||||
return null;
|
||||
return Instant.EPOCH;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -86,7 +86,7 @@ public class Overlay
|
|||
throw new IllegalStateException("No overly unpack directory");
|
||||
//only unpack if the overlay is newer
|
||||
Instant dirLastModified = Files.getLastModifiedTime(dir.toPath()).toInstant();
|
||||
if (!dir.exists() || (getResource().lastModified().isAfter(dirLastModified)))
|
||||
if (!dir.exists() || getResource().lastModified().isAfter(dirLastModified))
|
||||
getResource().copyTo(dir.toPath());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,7 +18,6 @@ import java.io.InputStream;
|
|||
import java.net.URI;
|
||||
import java.nio.channels.ReadableByteChannel;
|
||||
import java.nio.file.Path;
|
||||
import java.time.Instant;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -103,12 +102,6 @@ public class OrderingTest
|
|||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Instant lastModified()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long length()
|
||||
{
|
||||
|
|
|
@ -86,7 +86,7 @@ public class Overlay
|
|||
throw new IllegalStateException("No overly unpack directory");
|
||||
//only unpack if the overlay is newer
|
||||
Instant dirLastModified = Files.getLastModifiedTime(dir.toPath()).toInstant();
|
||||
if (!dir.exists() || (getResource().lastModified().isAfter(dirLastModified)))
|
||||
if (!dir.exists() || getResource().lastModified().isAfter(dirLastModified))
|
||||
getResource().copyTo(dir.toPath());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,7 +18,6 @@ import java.io.InputStream;
|
|||
import java.net.URI;
|
||||
import java.nio.channels.ReadableByteChannel;
|
||||
import java.nio.file.Path;
|
||||
import java.time.Instant;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -103,12 +102,6 @@ public class OrderingTest
|
|||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Instant lastModified()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long length()
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue