Examples of FileWrapper


Examples of net.sourceforge.squirrel_sql.fw.util.FileWrapper

  public ChannelXmlBean loadUpdateFromFileSystem(final String path)
  {
    ChannelXmlBean result = null;
    try
    {
      FileWrapper f = _fileWrapperFactory.create(path);
      if (!f.isDirectory())
      {
        s_log.error("FileSystem path (" + path + ") is not a directory.");
      }
      else
      {
View Full Code Here

Examples of net.sourceforge.squirrel_sql.fw.util.FileWrapper

   */
  public boolean downloadLocalUpdateFile(String fileToGet, String destDir) throws FileNotFoundException,
    IOException
  {
    boolean result = false;
    FileWrapper fromFile = _fileWrapperFactory.create(fileToGet);
    if (fromFile.isFile() && fromFile.canRead())
    {
      String filename = fromFile.getName();
      FileWrapper toFile = _fileWrapperFactory.create(destDir, filename);
      copyFile(fromFile, toFile);
      result = true;
    }
    else
    {
View Full Code Here

Examples of net.sourceforge.squirrel_sql.fw.util.FileWrapper

    if (!from.exists())
    {
      s_log.error("Cannot copy from file (" + from.getAbsolutePath() + ") which doesn't appear to exist.");
      return;
    }
    FileWrapper toFile = to;
    // Check to see if to is a directory and convert toFile to be the name of the file in that directory.
    if (to.isDirectory())
    {
      toFile = getFile(to, from.getName());
    }
    if (s_log.isDebugEnabled())
    {
      s_log.debug("Copying from file (" + from.getAbsolutePath() + ") to file ("
        + toFile.getAbsolutePath() + ")");
    }
    if (toFile.exists())
    {
      long fromCheckSum = getCheckSum(from);
      long toCheckSum = getCheckSum(toFile);
      if (fromCheckSum == toCheckSum)
      {
        if (s_log.isInfoEnabled())
        {
          s_log.info("File to be copied(" + from.getAbsolutePath() + ") has the same checksum("
            + fromCheckSum + ") as the file to copy to (" + toFile.getAbsolutePath()
            + "). Skipping copy.");
        }
        return;
      }
    }
View Full Code Here

Examples of net.sourceforge.squirrel_sql.fw.util.FileWrapper

  /**
   * @see net.sourceforge.squirrel_sql.client.update.UpdateUtil#getSquirrelHomeDir()
   */
  public FileWrapper getSquirrelHomeDir()
  {
    FileWrapper squirrelHomeDir = _appFileWrappers.getSquirrelHomeDir();
    if (!squirrelHomeDir.isDirectory())
    {
      s_log.error("SQuirreL Home Directory (" + squirrelHomeDir.getAbsolutePath()
        + " doesn't appear to be a directory");
    }
    return squirrelHomeDir;
  }
View Full Code Here

Examples of net.sourceforge.squirrel_sql.fw.util.FileWrapper

  /**
   * @see net.sourceforge.squirrel_sql.client.update.UpdateUtil#getSquirrelPluginsDir()
   */
  public FileWrapper getSquirrelPluginsDir()
  {
    FileWrapper squirrelHomeDir = _appFileWrappers.getPluginsDirectory();
    if (!squirrelHomeDir.isDirectory())
    {
      s_log.error("SQuirreL Plugins Directory (" + squirrelHomeDir.getAbsolutePath()
        + " doesn't appear to be a directory");
    }
    return squirrelHomeDir;
  }
View Full Code Here

Examples of net.sourceforge.squirrel_sql.fw.util.FileWrapper

  /**
   * @see net.sourceforge.squirrel_sql.client.update.UpdateUtil#getSquirrelLibraryDir()
   */
  public FileWrapper getSquirrelLibraryDir()
  {
    FileWrapper squirrelLibDir = _appFileWrappers.getLibraryDirectory();
    if (!squirrelLibDir.isDirectory())
    {
      s_log.error("SQuirreL Library Directory (" + squirrelLibDir.getAbsolutePath()
        + " doesn't appear to be a directory");
    }
    return squirrelLibDir;
  }
View Full Code Here

Examples of net.sourceforge.squirrel_sql.fw.util.FileWrapper

  /**
   * @see net.sourceforge.squirrel_sql.client.update.UpdateUtil#getChangeListFile()
   */
  public FileWrapper getChangeListFile()
  {
    FileWrapper updateDir = getSquirrelUpdateDir();
    FileWrapper changeListFile = _fileWrapperFactory.create(updateDir, CHANGE_LIST_FILENAME);
    return changeListFile;
  }
View Full Code Here

Examples of net.sourceforge.squirrel_sql.fw.util.FileWrapper

  /**
   * @see net.sourceforge.squirrel_sql.client.update.UpdateUtil#getLocalReleaseFile()
   */
  public FileWrapper getLocalReleaseFile() throws FileNotFoundException
  {
    FileWrapper result = null;
    try
    {
      FileWrapper[] files = getSquirrelHomeDir().listFiles();
      for (FileWrapper file : files)
      {
View Full Code Here

Examples of net.sourceforge.squirrel_sql.fw.util.FileWrapper

   * @see net.sourceforge.squirrel_sql.client.update.UpdateUtil#getInstalledTranslations()
   */
  public Set<String> getInstalledTranslations()
  {
    HashSet<String> result = new HashSet<String>();
    FileWrapper libDir = getSquirrelLibraryDir();
    for (String filename : libDir.list())
    {
      if (filename.startsWith("squirrel-sql_"))
      {
        result.add(filename);
      }
View Full Code Here

Examples of net.sourceforge.squirrel_sql.fw.util.FileWrapper

  /**
   * @see net.sourceforge.squirrel_sql.client.update.UpdateUtil#checkDir(FileWrapper, java.lang.String)
   */
  public FileWrapper checkDir(FileWrapper parent, String child)
  {
    FileWrapper dir = _fileWrapperFactory.create(parent, child);
    if (!dir.exists() && !dir.mkdir())
    {
      s_log.error("checkDir: Failed to mkdir - " + dir.getAbsolutePath());
    }
    return dir;
  }
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.