Karthikeya Boyini has Published 2383 Articles

ftp_pwd() function in PHP

karthikeya Boyini

karthikeya Boyini

Updated on 30-Jul-2019 22:30:24

40 Views

The ftp_pwd() function returns the present working directory i.e. the current directory.Syntaxftw_pwd(con)Parameterscon − The FTP connectionReturnThe ftp_pwd() function returns TRUE on success or FALSE on failure.ExampleThe following is an example −

Check for file or directory in Java

karthikeya Boyini

karthikeya Boyini

Updated on 30-Jul-2019 22:30:24

388 Views

The method java.io.File.isFile() is used to check whether the given file is an existing file in Java. Similarly, the method java.io.File.isDirectory() is used to check whether the given file is a directory in Java. Both of these methods require no parameters.A program that demonstrates this is given as follows −Examplepublic ... Read More

Display seconds with SimpleDateFormat(“s”) in Java

karthikeya Boyini

karthikeya Boyini

Updated on 30-Jul-2019 22:30:24

209 Views

To work with SimpleDateFormat class in Java, import the following package.import java.text.SimpleDateFormat;Now, set the format with SimpleDateFormat(“s”) to display seconds in one-digit.Format f = new SimpleDateFormat(”s”);Now, get the seconds in a string.String strSeconds = f.format(new Date());The following is an example −Example Live Demoimport java.text.Format; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Calendar; public ... Read More

Determine if file or directory exists in Java

karthikeya Boyini

karthikeya Boyini

Updated on 30-Jul-2019 22:30:24

6K+ Views

The method java.io.File.exists() is used to check whether a file or a directory exists or not. This method returns true if the file or directory specified by the abstract path name exists and false if it does not exist.A program that demonstrates this is given as follows −Exampleimport java.io.File; public ... Read More

NavigableSet Class lower() method in Java

karthikeya Boyini

karthikeya Boyini

Updated on 30-Jul-2019 22:30:24

58 Views

The lower() method of NavigableSet returns the greatest element strictly less than the given element i.e. 35 here −lower(35);The following is an example to implement the lower() method in Java −Example Live Demoimport java.util.NavigableSet; import java.util.TreeSet; public class Demo { public static void main(String[] args) { ... Read More

Java Program to check if a file or directory is readable

karthikeya Boyini

karthikeya Boyini

Updated on 30-Jul-2019 22:30:24

2K+ Views

The method java.io.File.canRead() is used to check if a file or directory is readable in Java. This method returns true if the file specified by the abstract path name can be read by an application and false otherwise.A program that demonstrates this is given as follows −Example Live Demoimport java.io.File; public ... Read More

Parse and format to arbitrary radix <= Character.MAX_RADIX in Java

karthikeya Boyini

karthikeya Boyini

Updated on 30-Jul-2019 22:30:24

186 Views

Let us set a radix here as.// radix int r = 32;Include the radix here as a BigInteger constructor.BigInteger one = new BigInteger("vv", r);Now get its string representation −String strResult = one.toString(radix);The following is an example −Example Live Demoimport java.math.*; public class Demo { public static void main(String[] ... Read More

ftp_raw() function in PHP

karthikeya Boyini

karthikeya Boyini

Updated on 30-Jul-2019 22:30:24

41 Views

The ftp_raw() function is used to sends raw command to the FTP server.Syntaxftp_raw(con, command)Parameterscon − The FTP connectioncommand − The command to executeReturnThe ftp_raw() function returns the server's response as an array of strings.ExampleThe following is an example −

Java Program to get name of specified file or directory

karthikeya Boyini

karthikeya Boyini

Updated on 30-Jul-2019 22:30:24

241 Views

The name of the specified file or directory can be obtained using the method java.io.File.getName(). The getName() returns the name of the file or the directory and it requires no parameters.A program that demonstrates this is given as follows −Example Live Demoimport java.io.File; public class Demo {    public static void ... Read More

Retrieve environment variables with Java Map Collection

karthikeya Boyini

karthikeya Boyini

Updated on 30-Jul-2019 22:30:24

401 Views

First, use the getenv() method to get the environment variables −System.out.println("PATH = " + System.getenv("PATH"));Now, get the key and value. Loop through to get the list of environment variables −Map e = System.getenv(); for (Iterator i = e.entrySet().iterator(); i.hasNext();) { Map.Entry mapEntry = (Map.Entry) i.next(); ... Read More

Advertisements