This example demonstrates the basic data manipulation operation in a File object. Java File object has set of methods to perform the following operations: Get the file last modified date Change the file modified date Lets look at the example to see how the above operations are implemented in Java example program. We use SImpleDateFormat …
How To Set The File Permissions In Java
Setting the file permissions in Java is OS specific. Each type of file system have different kind of file systems. Java provides the very generic solution to set the file permissions for all kind of file systems. This example demonstrates how to set file permissions to a file in the Linux operating system using Java …
Marker Interfaces in Java
Marker Interfaces in Java are special interfaces which don’t declare any methods inside the interface definition. Because of that, if a class implements the marker interface don’t need to override any methods. What is the use of marker interface in Java?. It implicitly imposes a functionality or characteristic to the implementing class. There are many …
Read An Object From File In Java (Deserialization)
In my previous tutorial I have explained about writing an object to a file using the serialization concept. Once you have written to a file, that file will be transferred across the network and would reach the destination. Once it is received, the receiver has to decode that file abd reading and converting back to …
Write An Object To File In Java (Serialization)
Java objects can be written to a file. If you implement Serializable interface to a class, implicitly that class is eligible for the serialization. Serializable is a marker interface which doesn’t have any methods defined. Serialization is the concept where an object can be converted to byte streams and transferred to the network. It is very much useful …
Compress Files To ZIP Format Using Java
This post demonstrates a simple example for how to compress your file and add to the ZIP file. Java has built-in API java.util.zip for compressing the files in ZIP format. It is very simple to read the files from your disk and writing to the destination ZIP file. It is straight forward. The steps involved …
Exception Handling in JSP
Java EE Tutorials JSP Tutorials Recommended Books for Java Server Pages (JSP) An exception is problem that occurs during the execution of any program. Exception can be categorized as: Runtime Exception – It is an exception that occurs during running (executing) the program. Checked Exception – It is a user error in the code. It cannot …
JSP Tutorials
Java Server Pages (JSP) is a view technology bundled with the Java Enterprise Edition (Java EE) specifications. It was considered as the default view technology for Java EE applications and alternative for the servlet applications. Where as servlet is a Java program which helps to write the plain Java class, JSP jelps you to write the …