Class HDFSAdapterImpl
- java.lang.Object
-
- io.mosip.kernel.fsadapter.hdfs.impl.HDFSAdapterImpl
-
- All Implemented Interfaces:
FileSystemAdapter
@Component public class HDFSAdapterImpl extends Object implements FileSystemAdapter
HDFS Adapter implementation for accessing the Hadoop Distributed File System- Since:
- 1.0.0
- Author:
- Dharmesh Khandelwal
-
-
Constructor Summary
Constructors Constructor Description HDFSAdapterImpl(ConnectionUtils connectionUtil)Constructor to initalize HDFSAdapter by injectingConnectionUtils
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancheckFileExistence(String id, String filePath)booleancopyFile(String sourcePacket, String sourceFilePath, String destinationPacket, String destinationFilePath)booleandeleteFile(String id, String filePath)booleandeletePacket(String id)InputStreamgetFile(String id, String filePath)StringgetFilePath(String filePath)Get formatted filePathorg.apache.hadoop.fs.PathgetHadoopPath(String id, String filePath)Construct a hadoop path from a StringInputStreamgetPacket(String id)booleanisPacketPresent(String id)booleanstoreFile(String id, String filePath, InputStream content)booleanstorePacket(String id, File file)booleanstorePacket(String id, InputStream content)voidunpackPacket(String id)
-
-
-
Constructor Detail
-
HDFSAdapterImpl
public HDFSAdapterImpl(ConnectionUtils connectionUtil)
Constructor to initalize HDFSAdapter by injectingConnectionUtils- Parameters:
connectionUtil- connectionUtil instanse
-
-
Method Detail
-
checkFileExistence
public boolean checkFileExistence(String id, String filePath)
- Specified by:
checkFileExistencein interfaceFileSystemAdapter
-
copyFile
public boolean copyFile(String sourcePacket, String sourceFilePath, String destinationPacket, String destinationFilePath)
- Specified by:
copyFilein interfaceFileSystemAdapter
-
deleteFile
public boolean deleteFile(String id, String filePath)
- Specified by:
deleteFilein interfaceFileSystemAdapter
-
deletePacket
public boolean deletePacket(String id)
- Specified by:
deletePacketin interfaceFileSystemAdapter
-
getFile
public InputStream getFile(String id, String filePath)
- Specified by:
getFilein interfaceFileSystemAdapter
-
getPacket
public InputStream getPacket(String id)
- Specified by:
getPacketin interfaceFileSystemAdapter
-
isPacketPresent
public boolean isPacketPresent(String id)
- Specified by:
isPacketPresentin interfaceFileSystemAdapter
-
storeFile
public boolean storeFile(String id, String filePath, InputStream content)
- Specified by:
storeFilein interfaceFileSystemAdapter
-
storePacket
public boolean storePacket(String id, File file)
- Specified by:
storePacketin interfaceFileSystemAdapter
-
storePacket
public boolean storePacket(String id, InputStream content)
- Specified by:
storePacketin interfaceFileSystemAdapter
-
unpackPacket
public void unpackPacket(String id)
- Specified by:
unpackPacketin interfaceFileSystemAdapter
-
getHadoopPath
public org.apache.hadoop.fs.Path getHadoopPath(String id, String filePath)
Construct a hadoop path from a String- Parameters:
id- the packetIdfilePath- the filePath- Returns:
- the path
-
-