Powered by Ajaxy
Digg StumbleUpon LinkedIn YouTube Flickr Facebook Twitter RSS Reset

Java: list serial and parallel ports

import javax.comm.*;
public class ListingPort
 {
  public static void main(String[] args) {
      // starting with COM1 
    try {
      int portNumbe

Java: Decrypt a file using SHA digest algorithm

import java.io.*;
import java.security.*;
import java.security.spec.*;
import javax.crypto.*;
import javax.crypto.spec.*;
public class DecryptDigestEx

Java: How to unzip a file

import java.util.*;
import java.util.zip.*;
import java.io.*;
public class UNZIP
Example
{
  public static void main(String[] args) throws IOExcep

Java: Encrypt a file using SHA digest algorithm

import java.io.*;
import java.security.*;
import javax.crypto.*;
import javax.crypto.spec.*;
public class SHAEncryptExample
{
  public static void mai

Java: rename a file

import java.io.*;
public class RenameFile
{
    public static void main(String[] argv) throws IOException {
        File fich = new File("test.txt");

Java: Conditional compilation

public class Debug
{
public static void main(String arg[]
{
final boolean DEBUG = false;
System.out.println("Welcom to mesexemple ");
  if (DEBUG)

Java: How to unpack a Pack200 file

import java.io.*;
import java.util.jar.*;
import java.util.zip.GZIPInputStream;
public class ExUnpack200
{
  public static void main(String[] args)

Java: Unzip files using ZipFile class

import java.util.*;
import java.util.zip.*;
import java.io.*;
public class UNZIPExample
{
  public static void main(String[] args) throws IOExce

Java: Creating New Directories

import java.io.*;
public class DirExample
{
 public static void main(String arg[])
 {
 	// Create two dir
 	new File("c:/sakoba").mkdir( );
	new File

Java: How to Unzip Pack200 file

import java.io.*;
import java.util.jar.*;
import java.util.zip.GZIPInputStream;
public class Unpack200Example
{
  public static void main(String[] arg

Java: How to remove a file

import java.io.*;
public class DeleteFile
{
    public static void main(String[] argv) throws IOException
    {
        File fich = new File("test.tx

Java: How to download files using java.io package

import java.net.*;
import java.nio.*;
import java.nio.channels.*;
import java.io.*;
public class URLDownload2 {
  public static void main(String[] arg

Java: provide information about each port

import javax.comm.*;
import java.util.*;
public class ID_Port {
  public static void main(String[] args)
  {
    Enumeration listePorts = CommPortIden

Java: Calculate the CRC32 checksum of a file

import java.io.*;
import java.util.zip.*;
public class CRC32Example
 {
  public static void main(String[] args) throws IOException
  {
      String f

Java: use CommPortIdentifier to list all the ports on the system

import javax.comm.*;
import java.util.*;
public class PortLister 
{
  public static void main(String[] args)
 {
    Enumeration enumer = CommPortIden