congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
FileWrapper
Code IndexAdd Tabnine to your IDE (free)

How to use
FileWrapper
in
net.sourceforge.squirrel_sql.fw.util

Best Java code snippets using net.sourceforge.squirrel_sql.fw.util.FileWrapper (Showing top 20 results out of 315)

origin: net.sf.squirrel-sql/squirrel-sql

if (path.exists())
  if (path.isFile())
    result = path.delete();
    if (s_log.isInfoEnabled())
        s_log.info("deleteFile: successfully deleted file = " + path.getAbsolutePath());
        s_log.info("deleteFile: failed to delete file = " + path.getAbsolutePath());
    FileWrapper[] files = path.listFiles();
    for (int i = 0; i < files.length; i++)
    result = result && path.delete();
origin: net.sf.squirrel-sql/squirrel-sql

if (file.isDirectory())
  zipFileOs(os, file.listFiles());
  try
    fis = new FileInputStream(file.getAbsolutePath());
    os.putNextEntry(new ZipEntry(file.getPath()));
    _iou.copyBytes(fis, os);
origin: net.sf.squirrel-sql/squirrel-sql

/**
 * @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);
    }
  }
  return result;
}
origin: net.sf.squirrel-sql/squirrel-sql

private void verifyDirectory(FileWrapper fromDir, FileWrapper toDir) {
  if (!fromDir.isDirectory()) { throw new IllegalArgumentException("Expected fromDir("
    + fromDir.getAbsolutePath() + ") to be a directory."); }
  if (!toDir.isDirectory()) { throw new IllegalArgumentException("Expected toDir("
    + toDir.getAbsolutePath() + ") to be a directory."); }		
}

origin: realXuJiang/bigtable-sql

/**
 * @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;
}
origin: net.sf.squirrel-sql/squirrel-sql

throws FileNotFoundException, IOException
FileWrapper[] files = fromDir.listFiles();
List<FileWrapper> filesToCopy = new ArrayList<FileWrapper>();
  boolean fileNameMatchesPattern = sourceFile.getName().matches(filePattern);
  if (matchPattern && fileNameMatchesPattern) {
    filesToCopy.add(sourceFile);
origin: net.sf.squirrel-sql/squirrel-sql

  downloadHttpUpdateFile(host, port, fileToGet, getDownloadsDir().getAbsolutePath(), -1, -1,
    proxySettings);
FileWrapper releaseXmlFile = _fileWrapperFactory.create(filename);
if (releaseXmlFile.exists())
origin: net.sf.squirrel-sql/squirrel-sql

/**
 * TODO: move to IOUtilities
 * 
 * @see net.sourceforge.squirrel_sql.client.update.UpdateUtil#createZipFile(FileWrapper, FileWrapper[])
 */
public void createZipFile(FileWrapper zipFile, FileWrapper... sourceFiles) throws FileNotFoundException,
  IOException
{
  ZipOutputStream os = new ZipOutputStream(new FileOutputStream(zipFile.getAbsolutePath()));
  zipFileOs(os, sourceFiles);
  os.close();
}
origin: net.sf.squirrel-sql/squirrel-sql

if (!outputDirectory.isDirectory())
  s_log.error("Output directory specified (" + outputDirectory.getAbsolutePath()
    + ") doesn't appear to be a directory");
  return;
try
  fis = new FileInputStream(zipFile.getAbsolutePath());
  zis = new ZipInputStream(fis);
  ZipEntry zipEntry = zis.getNextEntry();
      if (newFile.exists())
          s_log.info("Deleting extraction file that already exists:" + newFile.getAbsolutePath());
        newFile.delete();
      fos = new FileOutputStream(newFile.getAbsolutePath());
      byte[] buffer = new byte[ZIP_EXTRACTION_BUFFER_SIZE];
      int n = 0;
origin: net.sf.squirrel-sql.plugins/laf

  try
    if (file.isFile() && file.exists())
      lafs.put(className, file.toURI().toURL());
    s_log.error("Error occured reading Look and Feel jar: " + file.getAbsolutePath(), ex);
FileWrapper extraFile =
  fileWrapperFactory.create(extraLafsDir, ILAFConstants.USER_EXTRA_LAFS_PROPS_FILE);
BufferedInputStream is = new BufferedInputStream(extraFile.getFileInputStream());
try
    try
      if (file.isFile() && file.exists())
        lafs.put(className, file.toURI().toURL());
      s_log.error("Error occured reading Look and Feel jar: " + file.getAbsolutePath(), ex);
origin: net.sf.squirrel-sql/squirrel-sql

if (!result.isDirectory())
  if (result.exists())
    s_log.error(dirName + " directory (" + result.getAbsolutePath()
      + ") doesn't appear to be a directory");
      result.mkdir();
origin: realXuJiang/bigtable-sql

if (!file.exists())
  file.mkdirs();
if (!file.isDirectory())
  throw new IOException(s_stringMgr.getString("DefaultPlugin.error.cannotcreate", file.getAbsolutePath()));
origin: net.sf.squirrel-sql/squirrel-sql

IOException
if (!from.exists())
  s_log.error("Cannot copy from file (" + from.getAbsolutePath() + ") which doesn't appear to exist.");
  return;
if (to.isDirectory())
  toFile = getFile(to, from.getName());
  s_log.debug("Copying from file (" + from.getAbsolutePath() + ") to file ("
    + toFile.getAbsolutePath() + ")");
if (toFile.exists())
      s_log.info("File to be copied(" + from.getAbsolutePath() + ") has the same checksum("
        + fromCheckSum + ") as the file to copy to (" + toFile.getAbsolutePath()
        + "). Skipping copy.");
origin: net.sf.squirrel-sql/squirrel-sql

if (oldAppPreferenceFile.exists())
  if (oldAppPreferenceFile.lastModified() > newUserPreferenceFile.lastModified())
      + oldAppPreferenceFile.getAbsolutePath() + " as the source for preferences - will save "
      + "them to " + newUserPreferenceFile.getAbsolutePath());
      + newUserPreferenceFile.getAbsolutePath() + " is newer " + "than "
      + oldAppPreferenceFile.getAbsolutePath() + ": migration will be skipped");
    + oldAppPreferenceFile.getAbsolutePath() + " does not "
    + "exist! Please remove -DmigratePreferences from the "
    + "launch script, or fix -DoldSquirrelLocation to "
origin: net.sf.squirrel-sql.plugins/laf

_prefs.setThemePackDirectory(themePackDir.getAbsolutePath());
if (!themePackDir.exists())
  themePackDir.mkdirs();
origin: net.sf.squirrel-sql.plugins/hibernate

public static XMLBeanReader createHibernateConfigsReader(HibernatePlugin plugin)
   throws IOException, XMLException
{
 XMLBeanReader reader = new XMLBeanReader();
 FileWrapper pluginUserSettingsFolder = plugin.getPluginUserSettingsFolder();
 FileWrapper xmlFile = getXmlFile(pluginUserSettingsFolder);
 if (false == xmlFile.exists())
 {
   return null;
 }
 reader.load(xmlFile, plugin.getClass().getClassLoader());
 return reader;
}
origin: net.sf.squirrel-sql/squirrel-sql

/**
 * @see net.sourceforge.squirrel_sql.client.update.UpdateUtil#copyDir(
 * net.sourceforge.squirrel_sql.fw.util.FileWrapper,
 *      java.lang.String, boolean, net.sourceforge.squirrel_sql.fw.util.FileWrapper)
 */
@Override
public void moveFiles(FileWrapper fromDir, String filePattern, boolean matchPattern, FileWrapper toDir)
  throws FileNotFoundException, IOException
{
  if (StringUtils.isEmpty(filePattern)) {
    throw new IllegalArgumentException("filePattern arg cannot be empty or null");
  }
  if (!fromDir.isDirectory()) { throw new IllegalArgumentException("Expected fromDir("
    + fromDir.getAbsolutePath() + ") to be a directory."); }
  if (!toDir.isDirectory()) { throw new IllegalArgumentException("Expected toDir("
    + toDir.getAbsolutePath() + ") to be a directory."); }
  List<FileWrapper> filesToMove = getFilterFileList(fromDir, filePattern, matchPattern);
  for (FileWrapper file : filesToMove) {
    copyFile(file, toDir);
    if (s_log.isDebugEnabled()) {
      s_log.debug("moveFiles: Attempting to delete file "+file.getAbsolutePath());
    }
    if (file.delete()) {
      s_log.error("moveFiles: Unable to delete file "+file.getAbsolutePath());
    }
    
  }
}

origin: net.sf.squirrel-sql/squirrel-sql

    + File.separator;
FileWrapper file = fileWrapperFactory.create(name);
if (!file.exists())
  file.mkdirs();
if (!file.isDirectory())
origin: net.sf.squirrel-sql.plugins/laf

/**
 * Save preferences to disk.
 * 
 * @param prefsFile
 *           File to save preferences to.
 */
private void savePrefs(FileWrapper prefsFile) throws IOException, XMLException
{
  _settingsCache.save(prefsFile.getPath());
}
origin: net.sf.squirrel-sql.plugins/dbdiff

/**
 * @see net.sourceforge.squirrel_sql.plugins.dbdiff.IScriptFileManager#cleanupScriptFiles()
 */
public void cleanupScriptFiles()
{
  for (final String scriptFile : scriptFiles)
  {
    final FileWrapper fileWrapper = fileWrapperFactory.create(scriptFile);
    if (fileWrapper.exists())
    {
      if (s_log.isDebugEnabled())
      {
        s_log.debug("Attempting to delete previously created temporary script file: " + scriptFile);
      }
      fileWrapper.delete();
    }
    else
    {
      if (s_log.isDebugEnabled())
      {
        s_log.debug("Previously created temporary script file did not exist: " + scriptFile);
      }
    }
  }
}
net.sourceforge.squirrel_sql.fw.utilFileWrapper

Most used methods

  • exists
  • getAbsolutePath
  • getPath
  • delete
  • getFileWriter
  • isFile
  • list
  • listFiles
  • mkdir
  • mkdirs
  • toURI
  • canRead
  • toURI,
  • canRead,
  • deleteOnExit,
  • getFileInputStream,
  • getName,
  • isDirectory,
  • lastModified,
  • length,
  • createNewFile,
  • getBufferedReader

Popular in Java

  • Running tasks concurrently on multiple threads
  • addToBackStack (FragmentTransaction)
  • startActivity (Activity)
  • requestLocationUpdates (LocationManager)
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • Menu (java.awt)
  • KeyStore (java.security)
    KeyStore is responsible for maintaining cryptographic keys and their owners. The type of the syste
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • PriorityQueue (java.util)
    A PriorityQueue holds elements on a priority heap, which orders the elements according to their natu
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now