Skip to main content

Posts

Showing posts from June, 2015

Why ASUS ZENPHONE 2 should be in everyone's pocket

When I was looking for a cheap and best smartphone, then Asus Zenphone 2 is the one that comes in choice which comes in half the price of all top-tier smart phones and luckily nowhere near half the quality.  There are many features that makes this phone desirable like: 1) Design:  The luxurious ultra thin lollipop based Asus phone featured a hard plastic chassis available in multiple colors that make the phone even more desirable for me. the 72 % screen to body ratio and 1920 x 1080 full HD IPS display maximises the viewing experience. The removable back-panel gives access to a couple of micro-SIM slots and microSD slot. However, the battery is not user accessible. 2) 4 Gb RAM:  This ASUS Zenphone 2 comes with 4gb ram that makes this phone super fast . This also help me in watching movies, play games, video streaming and browsing much much faster as compare to other devices. 3) Processor The Zenfone runs on a 64-bit Intel Quadcore Z3580 processor that tops out at 2.3 GHz - a little s

How to delete a Folder in Java

Points To Remember Before deleting the file you need to check if you have permission to delete file using method canWrite() file specified exists exists() Deleting the file in Java Test.java import java.io.*; class Test{ public static void main(String args[]){ File file = new File("/home/ekansh/test"); if(file.isDirectory()){ if(file.delete()) System.out.println("Success ! Folder deleted."); else System.out.println("Failure ! Folder not deleted."); }else System.out.println("FOLDER DOES NOT EXIST"); } } Success ! Folder deleted.

How to create Nested folders in Java

Points To Remember You need to check the following things fro creating the nested folders If it is a directory by method isDirectory() If it exists by method exists() You might need to check if you have write permissions to create folder by method  canWrite() How to create Nested Folders/Directories in Java This is how yo can create the nested folders in java. CreateNestedFolders.java import java.io.*; class CreateNestedFolders{ public static void main(String args[]){ File file = new File("/home/ekansh/test/1/2/3/abc"); if(!file.canWrite()){ // check if user have write permissions if(!(file.exists() && file.isDirectory())){ if(file.mkdirs()) System.out.println("Success ! Folders created."); else System.out.println("Failure ! Folders not created."); } }else{ System.out.println("PERMISSION DENIED"); } } } Success ! Folders created.