Monday, 15 August 2016

Introduction about FileUtils class in java and example

   Normally in java we can perform File related operations with Files class like reading,writing files e.t.c. . But we can do more operations on files with third patry class that is FileUtils, provided by Apache foundation software. And this class 
included in commons-io-2.5.jar file, you can download it from this link  https://commons.apache.org/proper/commons-io/download_io.cgi
And include it in your project build path for usage.

We will get following functionalities with this class :-

1) Reading from a file
2) Writing to a file
3) Copying files and directories
4) Deleting files and directories
5) Comparing files content
6) Getting file last changed date
7) Listing files and many more...

Now we will look at simple example i.e writing string in to a file using FileUtils class. To do this operation we have a method i.e writeStringToFile in FileUtils class this simply writes mentioned string data in to a given file.Now let me write code
for this example.
package com.thirdparty;

import java.io.File;
import java.io.IOException;

import org.apache.commons.io.FileUtils;

public class Example {

	public static void main(String[] args) {

		
		String data = "Hello Programmer!";
		File file = new File("F://newdata.txt");
		try {
			FileUtils.writeStringToFile(file, data);
		} catch (IOException e) {
			System.out.println("Problem Occured");
			e.printStackTrace();
		}
	}

}

Sunday, 31 July 2016

How to get Integer maximum and minimum value in java?

In this example  we will code to get integer minimum and maximum values. Let's do code
package com.system;


/**
 * 
 * @author Sreekanth Gude
 * 
 */
public class DateToString {

 public static void main(String[] args) {

     // Getting Integer data type Minimum and maximum value.
  
  System.out.println("Integer Maximum Value: "+Integer.MAX_VALUE);
  System.out.println("Integer Minimum Value: "+Integer.MIN_VALUE);
 }

}

Sunday, 24 July 2016

Java Code Snippet: Converting Date to String in Java

package com.system;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

/**
 * 
 * @author Sreekanth Gude
 * 
 */
public class DateToString {

public static void main(String[] args) {

// Getting the Current Date By using calendar object
Date date= Calendar.getInstance().getTime();
System.out.println("date"+date);
// Creating the SimpleDateFormat instance by using formatting 
// Here we are specifying the required date format
DateFormat df =new SimpleDateFormat("dd/MM/yyyy");
// By using format method we are converting specified Date into string in a given format
String stringFormatOfDate=df.format(date);
System.out.println("stringFormatOfDate"+stringFormatOfDate);
}

}

Wednesday, 20 July 2016

Download Pokemon Go Free on android devices for Indian users only !!

   Hello gaming  lovers  you might be heard about  Pokemon Go game, today it is going viral across the world. This game officially launched by Niantic and The Pokemon Company on july 12. Now this game officially launched in US,Newzland, Zermany, Australlia and it is not yet released officially in any other region. Coming to indian users it is not available in Google play store. But here we have a way to download apk file from apkpure.com then we can easily install it on Android devices



Steps to download Pokeman Go game download:

1) First of all go through this link https://apkpure.com/pok%C3%A9mon-go/com.nianticlabs.pokemongo

2) Now click on download option. If your downloading it in your PC, then transfer it to your mobile. If your downloading from mobile then directly take it from downloads folder.
                                       
3)  Then click on that apk file it will ask's you to install the game. Then click on install option later click on next , next option

4) Now your done with Pokemon Game installation. Enjoy it.

Please do comment below if you have any problem with downloading and installation.

Here is the beginner's guide  to start Pokemon GO  game.


Sunday, 1 May 2016

How to get or download audio file(MP3 file) from youtube video without using any software with simple trick?


 Sometime you may want only audio file from any Youtube videos. For that you might have seen soo many software's to do that work,but you can achieve that with out using any software with simple 2 sec trick. Just follow the below steps

Step 1:-

Open Youtube Home page




Step 2:-

Select video which you want to download only audio file that is in MP3 format


Step 3:- 

Then you can see the full URL of the video in address bar. From that Remove "ube" from the youtube. See below


Orginal URL:- https://www.youtube.com/watch?v=jDn2bn7_YSM

After Removing "ube"  :- https://www.yout.com/watch?v=jDn2bn7_YSM

Then hit enter


Step 4:-

After completion of 3 rd step you will be redirected to new Screen. You can see below.




Step 5:-

Now your's favourite audio file ready to be download you can see at below of the browser




Powered by Jasper Roberts - Blog