Package net.sourceforge.squirrel_sql.fw.util

Examples of net.sourceforge.squirrel_sql.fw.util.FileWrapper.mkdir()


   @Test
   public void testCheckDir_notexists() {

     FileWrapper mockUpdateCoreDirectory = mockHelper.createMock(FileWrapper.class);
     expect(mockUpdateCoreDirectory.exists()).andReturn(false);
     expect(mockUpdateCoreDirectory.mkdir()).andReturn(true);
    
     expect(mockFileWrapperFactory.create(mockUpdateDirectory, UpdateUtil.CORE_ARTIFACT_ID));
     expectLastCall().andReturn(mockUpdateCoreDirectory);
    
    
View Full Code Here


   @Test
   public void testCheckDir_notexists_failure() {

     FileWrapper mockUpdateCoreDirectory = mockHelper.createMock(FileWrapper.class);
     expect(mockUpdateCoreDirectory.exists()).andReturn(false);
     expect(mockUpdateCoreDirectory.mkdir()).andReturn(false);
     expect(mockUpdateCoreDirectory.getAbsolutePath()).andReturn("/path/to/directory/that/was/not/made");
    
     expect(mockFileWrapperFactory.create(mockUpdateDirectory, UpdateUtil.CORE_ARTIFACT_ID));
     expectLastCall().andReturn(mockUpdateCoreDirectory);
    
View Full Code Here

      else
      {
        // If the downloads dir doesn't already exist, just create it.
        if (create)
        {
          result.mkdir();
        }
      }
    }
    return result;
  }
View Full Code Here

   * @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.