import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
+import java.net.URI;
+
+import org.eclipse.core.filesystem.EFS;
+import org.eclipse.core.filesystem.IFileSystem;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+
/**
* @author Changhyun Lee {@literal <changhyun1.lee@samsung.com>} (S-Core)
/**
* return file extension from given full file name
*
- * @author jihoon80.song@samsung.com, S-Core Inc.
+ * @author Jihoon Song {@literal <jihoon80.song@samsung.com>} (S-Core)
*/
public static String getFileExtension(String fullName) {
if (fullName == null) {
/**
* return file name without file extension from given full file name
*
- * @author jihoon80.song@samsung.com, S-Core Inc.
+ * @author Jihoon Song {@literal <jihoon80.song@samsung.com>} (S-Core)
*/
public static String getFileNameWithoutExtension(String fullName) {
if (fullName == null) {
/**
* delete file and its children.
*
- * @author jihoon80.song@samsung.com, S-Core Inc.
+ * @author Jihoon Song {@literal <jihoon80.song@samsung.com>} (S-Core)
*/
public static boolean recursiveDelete(File file) {
boolean result = true;
return result;
}
+ /**
+ * copy file or directory using Eclipse File System
+ *
+ * @param source The source URI of the copy.
+ * @param destination The destination URI of the copy.
+ * @param options bit-wise or of option flag constants ({@link EFS#OVERWRITE} or {@link EFS#SHALLOW}).
+ * @param monitor a progress monitor, or <code>null</code> if progress reporting and cancellation are not desired
+ *
+ * @author Jihoon Song {@literal <jihoon80.song@samsung.com>} (S-Core)
+ */
+ public static void copyUsingEFS(URI source, URI destination, int options, IProgressMonitor monitor) throws CoreException {
+ IFileSystem fileSystem = EFS.getLocalFileSystem();
+ fileSystem.getStore(source).copy(fileSystem.getStore(destination), options, monitor);
+ }
}