@Test public void testFixFilePathToFolder() { String bucketName = "s3:/"; String key = "bucketName"; SimpleEntry<String, String> newPath = s3FileObjectBucketSpy.fixFilePath( key, bucketName ); assertEquals( "bucketName", newPath.getValue() ); assertEquals( "", newPath.getKey() ); }
protected SimpleEntry<String, String> fixFilePath( String key, String bucket ) { String newBucket = bucket; String newKey = key; if ( !bucketExists( bucket ) ) { logger.debug( "Bucket {} from original path not found, might be an old path from the old driver", bucket ); if ( key.split( DELIMITER ).length > 1 ) { newBucket = key.split( DELIMITER )[0]; newKey = key.replaceFirst( newBucket + DELIMITER, "" ); } else { newBucket = key; newKey = ""; } } return new SimpleEntry<>( newKey, newBucket ); }
S3FileObject extends S3CommonFileObject { protected SimpleEntry<String, String> fixFilePath( String key, String bucket ) { String newBucket = bucket; String newKey = key; if ( !bucketExists( bucket ) ) { logger.debug( "Bucket {} from original path not found, might be an old path from the old driver", bucket ); if ( key.split( DELIMITER ).length > 1 ) { newBucket = key.split( DELIMITER )[0]; newKey = key.replaceFirst( newBucket + DELIMITER, "" ); } else { newBucket = key; newKey = ""; } } return new SimpleEntry<>( newKey, newBucket ); } }
S3FileObject extends S3CommonFileObject { protected SimpleEntry<String, String> fixFilePath( String key, String bucket ) { String newBucket = bucket; String newKey = key; if ( !bucketExists( bucket ) ) { logger.debug( "Bucket {} from original path not found, might be an old path from the old driver", bucket ); if ( key.split( DELIMITER ).length > 1 ) { newBucket = key.split( DELIMITER )[0]; newKey = key.replaceFirst( newBucket + DELIMITER, "" ); } else { newBucket = key; newKey = ""; } } return new SimpleEntry<>( newKey, newBucket ); } protected  S3FileObject( final AbstractFileName name, final S3FileSystem fileSystem ); }
S3FileObject extends S3CommonFileObject { protected SimpleEntry<String, String> fixFilePath( String key, String bucket ) { String newBucket = bucket; String newKey = key; if ( !bucketExists( bucket ) ) { logger.debug( "Bucket {} from original path not found, might be an old path from the old driver", bucket ); if ( key.split( DELIMITER ).length > 1 ) { newBucket = key.split( DELIMITER )[0]; newKey = key.replaceFirst( newBucket + DELIMITER, "" ); } else { newBucket = key; newKey = ""; } } return new SimpleEntry<>( newKey, newBucket ); } protected  S3FileObject( final AbstractFileName name, final S3FileSystem fileSystem );  }
S3FileObject extends S3CommonFileObject { protected SimpleEntry<String, String> fixFilePath( String key, String bucket ) { String newBucket = bucket; String newKey = key; if ( !bucketExists( bucket ) ) { logger.debug( "Bucket {} from original path not found, might be an old path from the old driver", bucket ); if ( key.split( DELIMITER ).length > 1 ) { newBucket = key.split( DELIMITER )[0]; newKey = key.replaceFirst( newBucket + DELIMITER, "" ); } else { newBucket = key; newKey = ""; } } return new SimpleEntry<>( newKey, newBucket ); } protected  S3FileObject( final AbstractFileName name, final S3FileSystem fileSystem );   }