Skip to content

Commit

Permalink
Uses FileSystemAbstraction to check if file exists
Browse files Browse the repository at this point in the history
  • Loading branch information
tinwelint committed Mar 15, 2012
1 parent af09d8e commit 2367a6c
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public IndexProviderStore( File file, FileSystemAbstraction fileSystem, long exp
try
{
// Create it if it doesn't exist
if ( !file.exists() )
if ( !fileSystem.fileExists( file.getAbsolutePath() ) )
create( file, fileSystem, expectedVersion );

// Read all the records in the file
Expand Down Expand Up @@ -126,7 +126,7 @@ private Long[] readRecordsWithNullDefaults( FileChannel fileChannel, int count,

private void create( File file, FileSystemAbstraction fileSystem, long indexVersion ) throws IOException
{
if ( file.exists() )
if ( fileSystem.fileExists( file.getAbsolutePath() ) )
throw new IllegalArgumentException( file + " already exist" );

FileChannel fileChannel = null;
Expand Down

0 comments on commit 2367a6c

Please sign in to comment.