Package org.pdfsam.console.exceptions.console

Examples of org.pdfsam.console.exceptions.console.ConsoleException


        this.fileName = fileName.substring(0, fileName.lastIndexOf('.'));
      }else{
        this.fileName = fileName;
      }
    }else{
      throw new ConsoleException(ConsoleException.EMPTY_FILENAME);
    }   
  }
View Full Code Here


                // check if overwrite is allowed
                if (overwrite) {
                    if (outputFile.delete()) {
                        renameFile(tmpFile, outputFile);
                    } else {
                        throw new ConsoleException(ConsoleException.UNABLE_TO_OVERWRITE, new String[] { tmpFile
                                .getName() });
                    }
                } else {
                    throw new ConsoleException(ConsoleException.OVERWRITE_IS_FALSE, new String[] { tmpFile.getName() });
                }
            } else {
                renameFile(tmpFile, outputFile);
            }
        } else {
View Full Code Here

     * @throws ConsoleException
     *             if an error occur
     */
    private static void renameFile(File tmpFile, File outputFile) throws ConsoleException {
        if (!tmpFile.renameTo(outputFile)) {
            throw new ConsoleException(ConsoleException.UNABLE_TO_RENAME, new String[] { tmpFile.getName(),
                    outputFile.getName() });
        }
    }
View Full Code Here

        FileUtility.renameTemporaryFile(tmpFile, inputCommand.getOutputFile(), inputCommand.isOverwrite());
        LOG.debug("File " + inputCommand.getOutputFile().getCanonicalPath() + " created.");

      } catch (Exception e) {
        throw new ConsoleException(e);
      } finally {
        setWorkCompleted();
      }
    } else {
      throw new ConsoleException(ConsoleException.ERR_BAD_COMMAND);
    }

  }
View Full Code Here

                    cmdExecutor.addObserver(this);
                    cmdExecutor.execute(parsedCommand);
                    LOG.info("Command '" + parsedCommand.getCommand() + "' executed in "
                            + DurationFormatUtils.formatDurationWords(stopWatch.getTime(), true, true));
                } else {
                    throw new ConsoleException(ConsoleException.CMD_LINE_EXECUTOR_NULL, new String[] { ""
                            + parsedCommand.getCommand() });
                }
            } else {
                throw new ConsoleException(ConsoleException.CMD_LINE_NULL);
            }
        } finally {
            stopWatch.stop();
            cleanExecutor();
        }
View Full Code Here

        throw new EncryptException(e);
      } finally {
        setWorkCompleted();
      }
    } else {
      throw new ConsoleException(ConsoleException.ERR_BAD_COMMAND);
    }
  }
View Full Code Here

        throw new SetViewerException(e);
      }finally{
        setWorkCompleted();
      }   
    }else{
      throw new ConsoleException(ConsoleException.ERR_BAD_COMMAND);
    }

  }
View Full Code Here

                throw new ConcatException(e);
            } finally {
                setWorkCompleted();
            }
        } else {
            throw new ConsoleException(ConsoleException.ERR_BAD_COMMAND);
        }

    }
View Full Code Here

        throw new SlideShowException(e);
      }finally{
        setWorkCompleted();
      }
    }else{
      throw new ConsoleException(ConsoleException.ERR_BAD_COMMAND);
    }
  }
View Full Code Here

        LOG.info("Pdf files decrypted in "+inputCommand.getOutputFile().getAbsolutePath()+".");
      }finally{
        setWorkCompleted();
      }
    }else{
      throw new ConsoleException(ConsoleException.ERR_BAD_COMMAND);
    }
  }
View Full Code Here

TOP

Related Classes of org.pdfsam.console.exceptions.console.ConsoleException

Copyright © 2018 www.massapicom. 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.