Skip to content

Commit

Permalink
Revert "Revert "Revert "Renamed FileMoveAction helpers from copy to…
Browse files Browse the repository at this point in the history
… `move`"""

This reverts commit 2320cdb.
  • Loading branch information
phughk committed Jun 28, 2018
1 parent b6ccf4c commit 66dc5de
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
Expand Up @@ -38,7 +38,7 @@ public interface FileMoveAction

File file();

static FileMoveAction moveViaPageCache( File file, PageCache pageCache )
static FileMoveAction copyViaPageCache( File file, PageCache pageCache )
{
return new FileMoveAction()
{
Expand All @@ -61,7 +61,7 @@ public File file()
};
}

static FileMoveAction moveViaFileSystem( File file, File basePath )
static FileMoveAction copyViaFileSystem( File file, File basePath )
{
Path base = basePath.toPath();
return new FileMoveAction()
Expand Down
Expand Up @@ -175,8 +175,8 @@ private FileMoveAction moveFileCorrectly( File fileToMove, File basePath )
{
if ( fileMoveActionInformer.shouldBeManagedByPageCache( fileToMove.getName() ) )
{
return FileMoveAction.moveViaPageCache( fileToMove, pageCache );
return FileMoveAction.copyViaPageCache( fileToMove, pageCache );
}
return FileMoveAction.moveViaFileSystem( fileToMove, basePath );
return FileMoveAction.copyViaFileSystem( fileToMove, basePath );
}
}
Expand Up @@ -103,7 +103,7 @@ public long write( String path, ReadableByteChannel data, ByteBuffer temporaryBu
// the page cache later on when we want to move the files written through the page cache.
private void addPageCacheMoveAction( File file )
{
fileMoveActions.add( FileMoveAction.moveViaPageCache( file, pageCache ) );
fileMoveActions.add( FileMoveAction.copyViaPageCache( file, pageCache ) );
}

private int filePageSize( int alignment )
Expand Down
Expand Up @@ -59,7 +59,7 @@ public void pageCacheFilesMovedDoNotLeaveOriginal() throws IOException

// when
File targetRename = new File( "target" );
FileMoveAction.moveViaPageCache( pageCacheFile, pageCache ).move( targetRename );
FileMoveAction.copyViaPageCache( pageCacheFile, pageCache ).move( targetRename );

// then
assertFalse( pageCacheFile.exists() );
Expand All @@ -84,7 +84,7 @@ public void nonPageCacheFilesMovedDoNotLeaveOriginal() throws IOException
assertFalse( targetFile.exists() );

// when
FileMoveAction.moveViaFileSystem( sourceFile, sourceDirectory ).move( targetDirectory );
FileMoveAction.copyViaFileSystem( sourceFile, sourceDirectory ).move( targetDirectory );

// then
assertTrue( targetFile.exists() );
Expand Down

0 comments on commit 66dc5de

Please sign in to comment.