Examples of IoException


Examples of java.io.IOException

            intSrc |= (src[1]&0xFF);
            doubleByteMappings.put( new Integer( intSrc ), dest );
        }
        else
        {
            throw new IOException( "Mapping code should be 1 or two bytes and not " + src.length );
        }
    }
View Full Code Here

Examples of java.io.IOException

    public void close() throws IOException {
        try {
            source.close();
            super.close();
        } catch (SQLException e) {
            throw new IOException(e.getMessage());
        }
    }
View Full Code Here

Examples of java.io.IOException

                }
                sb.append("\n"); //$NON-NLS-1$
                return sb.toString();
            }
        } catch (SQLException e) {
            throw new IOException(e.getMessage());
        }       
        return null;
    }
View Full Code Here

Examples of java.io.IOException

    File temp = File.createTempFile("temp", Long.toString(System.nanoTime()));

    temp.delete();

    if (!(temp.mkdir())) {
      throw new IOException("Could not create temp directory: "
          + temp.getAbsolutePath());
    }

    return temp;
  }
View Full Code Here

Examples of java.io.IOException

          (! line.trim().equals("")) &&
          (! line.startsWith("#"))) {
        StringTokenizer st = new StringTokenizer(line);
        // did we get 2 tokens ?
        if (st.countTokens() != 2) {
          throw new IOException("line "+lineno+" don't consists of 2 fields");
        }

        String allowStr = st.nextToken();
        boolean allow = true;
        String expression = st.nextToken();

        // allow or deny ?
        if (allowStr.equalsIgnoreCase("allow")) {
          allow=true;
        } else if (allowStr.equalsIgnoreCase("deny")) {
          allow=false;
        } else {
          throw new IOException("first token in line "+lineno+
          " has to be allow or deny");
        }

        addRule(expression,allow);
      }
View Full Code Here

Examples of java.io.IOException

    (! line.trim().equals("")) &&
    (! line.startsWith("#"))) {
  StringTokenizer st = new StringTokenizer(line);
  // we need at least 2 tokens
  if (st.countTokens() < 2) {
    throw new IOException("line "+lineno+" has less then 2 fields");
  }

  String allowStr = st.nextToken();
  boolean allow = true;
  String mime = st.nextToken();

  // allow or deny ?
  if (allowStr.equalsIgnoreCase("allow")) {
    allow=true;
  } else if (allowStr.equalsIgnoreCase("deny")) {
    allow=false;
  } else {
    throw new IOException("first token in line "+lineno+
        " has to be allow or deny");
  }
   
 
  DownloadRule r = new DownloadRule();
  r.setAllow(allow);
  try {
    r.setMimeType(mime);
  } catch (IllegalArgumentException e) {
    throw new IOException(e.getMessage());
  }
 

  // parse < and > rules
  while (st.hasMoreTokens()) {
    boolean isMin=true;

    String descr=st.nextToken();
   
    if (descr.startsWith("<")) {
      // it is a maximum value
      isMin=false;
    } else if (descr.startsWith(">")) {
      isMin=true;
    } else {
      throw new IOException("can't understand "+descr+
          " in line "+lineno);
    }

    int size=0;
    try {
      size = Integer.parseInt(descr.substring(1));
    } catch (NumberFormatException e) {
      throw new IOException("no numerical value "+descr+
          " in line "+lineno);
    }

    if (isMin) {
      r.setMinSize(size);
View Full Code Here

Examples of java.io.IOException

    }

    try {
      chunkCount = Integer.parseInt(line.trim(),16);
    } catch (NumberFormatException e) {
      throw new IOException("malformed chunk ("+line+")");
    }
    contentLength += chunkCount;
    if ( chunkCount == 0 ) {
      readFooters();
    }
View Full Code Here

Examples of java.io.IOException

        }

        //
        // Password not found
        //
        throw new IOException();
    }
View Full Code Here

Examples of java.io.IOException

        }
       
        //
        // Password not found
        //
        throw new IOException();
    }
View Full Code Here

Examples of java.io.IOException

           
            try {
                client.validateTransfer();
            }
            catch (FTPException ex) {
                throw new IOException(ex.getMessage());
            }
           
            if (monitorEx != null)
                monitorEx.transferComplete(TransferDirection.DOWNLOAD, remoteFile);
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.