Topics Search

How to make hidden files in Java Program with Example

How to make hidden files in Java Program with Example
Views: 20
we will see how to hide file in Java or make hidden file in Java. As we said File API in Java doesn’t provide any method to make a file hidden in Java but still you can apply some quick tricks to hide files from Java program. Like in Unix environment any file whose names begin with dot (.) is hidden so you can name your file starting with dot (.) and your File will be hidden in Linux or Unix Environment.
Sponsored Links:

Similar posts...


How to find hidden file with Example

How to find hidden file with Example Icon
You can check hidden files from Java program by using File API and isHidden()method of Java class.

How to Run a JAR file from Command Prompt

How to Run a JAR file from Command Prompt Icon
So you got a JAR file which contains your favorite Java game and you are wondering how to run Java program from JAR file? Or you may be simply trying your hand after running Java program from the command prompt and Eclipse IDE. Anyway, it's good to know How to execute Java program from JAR file, as JAR file is a most popular way of shipping Java programs. JAR file usually contains all source and resource in the form of class files, images, sound files etc.

Java File I/O Basics

Java File I/O Basics Icon
Java 7 introduced the java.nio.file package to provide comprehensive support for file I/O. Besides a lot of other functionality this package includes the Files class (if you already use this class you can stop reading here). Files contains a lot of static methods that can be used to accomplish common tasks when working with files. Unfortunately it looks to me that still a lot of newer (Java 7+) code is written using old (pre Java 7) ways of working with files. This does not have to be bad, but it can make things more complex than needed.

Java compile in Java

Java compile in Java Icon
The Java compiler reads source files and generates class files. (Assembling them to JAR, WAR, EAR and other packages is the responsibility of a different tool.) The source files and class files do not necessarily need to be real operating system files residing in a magnetic disk, SSD or memory drive. After all Java is usually good about abstraction when it comes to the run-time API and this is the case now.

A Deeper Look at Java Methods

A Deeper Look at Java Methods Icon
A Java application generally consists of a large set of instructions. It is practically unmanageable if it is written as a single piece of code strewn across the program. Java methods provide a way to construct a large program assembled from small pieces of code called modules. Java methods emphasize the divide and conquer principle facilitating design, implementation, operation, and maintenance of a large program. Java methods exist along with Java objects, but there is an exception with static methods. The method designated as static is independent of the Java object and can be invoked without creating one. This article shall explore the intricacies of methods and how things actually work in Java.

How to Use Locks in Multi-threaded Java Program

How to Use Locks in Multi-threaded Java Program Icon
Many Java programmers confused themselves like hell while writing multi-threaded Java programs e.g. where to synchronized? Which Lock to use? What Lock to use etc. I often receive request to explain about how to use Locks in Java, so I thought to write a simple Java program, which is multi-threaded and uses rather new Lock interface. Remember Lock is your tool to guard shared resource which can be anything e.g. database, File system, a Prime number Generator or a Message processor. Before using Locks in Java program...

How to read Environment Variables

How to read Environment Variables Icon
There are two ways to get environment variable in Java, by using System properties or by using System.getEnv(). System properties provides only limited set of predefined environment variables like java.classpath, for retriving Java Classpath or java.username to get User Id which is used to run Java program etc but a more robust and platform independent way of getting environment variable in Java program on the other hand Sytem.getEnv() method provide access to all environment variables inside Java program but subject to introduce platform dependency if program relies on a particular environment variable.

Working with Java Archive Files

Working with Java Archive Files Icon
An archive refers to a collection of one or more files put together as a single unit. Often in Java programs, we come across an archive file called a JAR (Java Archive). This type of file is common to every Java programmer. Archive files are created by using file archive software such as WinZip, 7-zip, tar, and so forth. These types of files are particularly useful to store and transmit multiple files as a single unit. File archives sometime employ data compression and encryption as well. This article delves into some of the key concepts of working with archive files by using Java programming.

How To Use Source and Target Parameter in Java Compiler

How To Use Source and Target Parameter in Java Compiler Icon
If you are a Java programmer, then one of the common question comes into mind is How do I compile for compatibility with older versions of Java?. When you run your Java program with an older version of the Java runtime environment, you may get the following Java exception if you have not compiled with the right version of Java language...

Loading Java Properties Files

Loading Java Properties Files Icon
Java Properties files are amazing resources to add information in Java. Generally these files are used to store static information in key and value pair. Things that you do not want to hard code in your Java code goes into properties files.
Although there are multiple ways of loading properties file, I will be focusing on loading the resource bundle files from class path resources. There are advantages of adding properties files in the classpath: