Skip to content

Commit

Permalink
Revert "Renamed FileMoveAction helpers from copy to move"
Browse files Browse the repository at this point in the history
This reverts commit c13c607.
  • Loading branch information
phughk committed Jun 25, 2018
1 parent 8844085 commit 1f8b326
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(); File file();


static FileMoveAction moveViaPageCache( File file, PageCache pageCache ) static FileMoveAction copyViaPageCache( File file, PageCache pageCache )
{ {
return new FileMoveAction() 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(); Path base = basePath.toPath();
return new FileMoveAction() return new FileMoveAction()
Expand Down
Expand Up @@ -175,8 +175,8 @@ private FileMoveAction moveFileCorrectly( File fileToMove, File basePath )
{ {
if ( fileMoveActionInformer.shouldBeManagedByPageCache( fileToMove.getName() ) ) 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. // the page cache later on when we want to move the files written through the page cache.
private void addPageCacheMoveAction( File file ) private void addPageCacheMoveAction( File file )
{ {
fileMoveActions.add( FileMoveAction.moveViaPageCache( file, pageCache ) ); fileMoveActions.add( FileMoveAction.copyViaPageCache( file, pageCache ) );
} }


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


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


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


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


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

0 comments on commit 1f8b326

Please sign in to comment.