Examples of FileWrapper


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

        {
          checkDir(outputDirectory, name);
        }
        else
        {
          FileWrapper newFile = _fileWrapperFactory.create(outputDirectory, name);
          if (newFile.exists())
          {
            if (s_log.isInfoEnabled())
            {
              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;
          while ((n = zis.read(buffer, 0, ZIP_EXTRACTION_BUFFER_SIZE)) > -1)
          {
            fos.write(buffer, 0, n);
View Full Code Here

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

  }

  private String getArtifactDownloadDestDir(ArtifactStatus status)
  {

    FileWrapper destDir = _util.getCoreDownloadsDir();
    if (UpdateUtil.PLUGIN_ARTIFACT_ID.equals(status.getType()))
    {
      destDir = _util.getPluginDownloadsDir();
    }
    if (UpdateUtil.TRANSLATION_ARTIFACT_ID.equals(status.getType()))
    {
      destDir = _util.getI18nDownloadsDir();
    }
    return destDir.getAbsolutePath();
  }
View Full Code Here

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

  }

  @Test
  public void testGetSetFileToInstall()
  {
    FileWrapper mockNewFileToInstall = mockHelper.createMock(FileWrapper.class);
   
    mockHelper.replayAll();
    assertEquals(mockFileToInstall, classUnderTest.getFileToInstall());
    classUnderTest.setFileToInstall(mockNewFileToInstall);
    assertEquals(mockNewFileToInstall, classUnderTest.getFileToInstall());
View Full Code Here

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

  }

  @Test
  public void testGetSetInstallDir()
  {
    FileWrapper mockNewInstallDir = mockHelper.createMock(FileWrapper.class);
   
    mockHelper.replayAll();
    assertEquals(mockInstallDir, classUnderTest.getInstallDir());
    classUnderTest.setInstallDir(mockNewInstallDir);
    assertEquals(mockNewInstallDir, classUnderTest.getInstallDir());
View Full Code Here

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

   */
  @Test
  public void testUpdateLaunchScript() throws IOException
  {
   
    FileWrapper sourceScriptFile = _fileWrapperFactory.create(SOURCE_SCRIPT_FILE_TO_TEST);
    FileWrapper targetScriptFile = _fileWrapperFactory.create(TARGET_SCRIPT_FILE_TO_TEST);
    ioutils.copyFile(sourceScriptFile, targetScriptFile);

    // Confirm that the script doesn't contain the splash screen icon setting.
    checkScriptFile(false);
   
View Full Code Here

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

          releasePath.toString(), RELEASE_XML_FILENAME, _app.getSquirrelPreferences().getProxySettings());
    }
    else
    {
      // 4b. Copy the release.xml file to the download directory then load the current release channel bean
      FileWrapper updateSiteReleaseXmlFilePath =
        fileWrapperFactory.create(settings.getFileSystemUpdatePath(), RELEASE_XML_FILENAME);
      FileWrapper downloadReleaseXmlFile =
        fileWrapperFactory.create(_util.getDownloadsDir(), RELEASE_XML_FILENAME);
      _util.copyFile(updateSiteReleaseXmlFilePath, downloadReleaseXmlFile);
      _currentChannelBean = _util.loadUpdateFromFileSystem(settings.getFileSystemUpdatePath());
    }
View Full Code Here

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

  @Test
  public final void testGetSetChangeListFile()
  {

    FileWrapper mockChangeListFile = helper.createMock(FileWrapper.class);

    helper.replayAll();
    FileWrapper result = implUnderTest.getChangeListFile();
    assertNull(result);
    implUnderTest.setChangeListFile(mockChangeListFile);
    result = implUnderTest.getChangeListFile();
    Assert.assertNotNull(result);
    helper.verifyAll();
View Full Code Here

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

    setupFileCopyOperationInfo(mockDownloadsDbCopyPluginZipFile, mockSquirrelPluginsDirFile,
      mockInstallDbCopyZipOperationInfo, isPlugin);
    setupFileCopyOperationInfo(mockDownloadsSquirrelSqlEsJarFile, mockSquirreLLibDirFile,
      mockInstallSquirrelSqlEsOperationInfo, isNotPlugin);

    FileWrapper mockChangeListFile = helper.createMock("mockChangeListFile", FileWrapper.class);
    mockUpdateUtil.copyFile(mockChangeListFile, mockBackupRootDirFile);
    expect(mockUpdateUtil.deleteFile(mockChangeListFile)).andReturn(true);
    expect(mockUpdateUtil.deleteFile(mockLocalReleaseFile)).andReturn(true);

    mockUpdateUtil.copyFile(mockDownloadReleaseFile, mockUpdateRootDirFile);
View Full Code Here

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

  {

    List<ArtifactStatus> changeList = getSquirrelSqlEsJarChangeList();
    expect(mockChangeListBean.getChanges()).andStubReturn(changeList);

    FileWrapper mockChangeListFile = helper.createMock("mockChangeListFile", FileWrapper.class);
    mockUpdateUtil.copyFile(mockChangeListFile, mockBackupRootDirFile);
    expect(mockUpdateUtil.deleteFile(mockChangeListFile)).andReturn(true);
    expect(mockUpdateUtil.getLocalReleaseFile()).andThrow(
      new FileNotFoundException("simulate local release doesn't exist"));
View Full Code Here

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

  }

  @Test
  public void testCreate()
  {
    FileWrapper fileToCopy = mockHelper.createMock("fileToCopy", FileWrapper.class);
    FileWrapper installDir = mockHelper.createMock("installDir", FileWrapper.class);
    InstallFileOperationInfo info = classUnderTest.create(fileToCopy, installDir);
    assertNotNull(info);
    assertEquals(fileToCopy, info.getFileToInstall());
    assertEquals(installDir, info.getInstallDir());
  }
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.