From ce5d62c78273b45d505c35dcbcc5727e62a46934 Mon Sep 17 00:00:00 2001 From: "kh5325.kim" Date: Wed, 16 Oct 2013 12:38:39 +0900 Subject: [PATCH] Removed deprecated copyFile and createFile methods Change-Id: Id912f2dc28a1fd75cc7a8f5d35471961ab42143e Signed-off-by: kh5325.kim --- .../src/org/tizen/common/rds/RdsDeltaDetector.java | 4 +- .../src/org/tizen/common/util/HostUtil.java | 81 ---------------------- 2 files changed, 1 insertion(+), 84 deletions(-) diff --git a/org.tizen.common/src/org/tizen/common/rds/RdsDeltaDetector.java b/org.tizen.common/src/org/tizen/common/rds/RdsDeltaDetector.java index 32df5f0..9f57ea6 100755 --- a/org.tizen.common/src/org/tizen/common/rds/RdsDeltaDetector.java +++ b/org.tizen.common/src/org/tizen/common/rds/RdsDeltaDetector.java @@ -256,9 +256,7 @@ public class RdsDeltaDetector { } finally { IOUtil.tryClose(output); try { - if (project!=null) { - project.refreshLocal(IResource.DEPTH_ONE, new NullProgressMonitor()); - } + project.refreshLocal(IResource.DEPTH_ONE, new NullProgressMonitor()); } catch (CoreException e) { logger.error("Could not refresh project resources...", e); } diff --git a/org.tizen.common/src/org/tizen/common/util/HostUtil.java b/org.tizen.common/src/org/tizen/common/util/HostUtil.java index 352c689..8a55b3d 100755 --- a/org.tizen.common/src/org/tizen/common/util/HostUtil.java +++ b/org.tizen.common/src/org/tizen/common/util/HostUtil.java @@ -275,85 +275,4 @@ public abstract class HostUtil{ return new String[]{SHELL_COMMAND_LINUX,"-c",command}; //$NON-NLS-1$ } } - - /** - * @deprecated Use {@link FileUtil#createFile(File)}, - * {@link FileUtil#createFile(String)}, - * {@link FileUtil#createFile(String, String)} - * or - * {@link FileUtil#createTextFile(File, String, String)}, - * {@link FileUtil#createTextFile(String, String, String)}, - * {@link FileUtil#createTextFile(String, String, String, String)} - * and - * {@link FileUtil#createDirectory(File)}, - * {@link FileUtil#createDirectory(String)}, - * {@link FileUtil#createDirectory(String, String)} - * instead. - */ - @Deprecated - public static boolean createFile(String path, String contents) { - BufferedWriter output = null; - try { - File file = new File(path); - - File folder = file.getParentFile(); - if(folder!=null) - { - folder.mkdirs(); - } - - file.createNewFile(); - - output = new BufferedWriter(new FileWriter(file)); - output.write(contents); - return true; - } catch ( IOException e) { - logger.info( "Exception occurred:", e ); - return false; - }finally{ - tryClose( output ); - } - } - - - /** - * @deprecated Use {@link FileUtil#copyTo(String, String)} instead. - * @throws IOException - */ - @Deprecated - public static boolean copyFile(String src, String des) throws IOException { - boolean canExecute = false; - File srcFile=new File(src); - File desFile=null; - FileInputStream fis=null; - FileOutputStream fos=null; - FileChannel fcin=null; - FileChannel fcout=null; - - canExecute = srcFile.canExecute(); - - desFile= new File(des); - File paths = new File(desFile.getAbsolutePath().substring(0, desFile.getAbsolutePath().lastIndexOf("/"))); //$NON-NLS-1$ - if (!paths.exists()) { - paths.mkdirs(); - } - - try { - fis= new FileInputStream(srcFile); - fos= new FileOutputStream(desFile); - fcin= fis.getChannel(); - fcout= fos.getChannel(); - - long size= fcin.size(); - fcin.transferTo(0, size, fcout); - desFile.setExecutable(canExecute); - }finally{ - tryClose( fcout, fcin, fos, fis ); - } - - return true; - } - } - - -- 2.7.4