小编use*_*274的帖子

Git operations occasionally hang in Jenkins on Windows

We are running continuous Jenkins builds of a Git project hosted at Assembla. Jenkins is running on Tomcat 6 under its own user and generally works fine.

However every once in a while (say once in every 10 builds), the checkout operation at the beginning of the build job simply hangs. At other times the Git tag operation at the end of the build also hangs. I believe this did not ever happen in command-line operation (on the same host with …

windows git assembla jenkins gitblit

15
推荐指数
2
解决办法
7700
查看次数

java.nio.file.Files.isWriteable与java.io.File.canWrite()不一致

我有Java代码执行以下操作:

  1. 使用ZIP扩展创建临时空文件 File.createTempFile()
  2. 删除它File.delete()(我们真的只想生成一个临时文件名)
  3. com.google.commons.io.ByteStreams.copy()使用OutputSupplier给定相同文件名的新文件将"模板"ZIP文件复制到同一路径
  4. 使用TrueZIP 7.4.3修改ZIP存档(删除目录)

在特定系统上,第4步一致失败FsReadOnlyArchiveFileSystemException - "This is a read-only archive file system!"(参见http://java.net/projects/truezip/lists/users/archive/2011-05/message/9)

调试TrueZIP代码,我注意到以下内容:

  • 在上述任何步骤之间,此文件上没有打开的文件句柄,特别是在步骤4之前
  • 使用File.canWrite()检查同一文件而不是NIO以完全相同的时间(使用调试器)返回,它表明它是可写的

以下是您在调试器表达式列表中看到的内容:

fn => "C:/myworkdir/temp/myfile4088293380313057223tmp.zip"
java.nio.file.Files.isWritable(java.nio.file.Paths.get(fn)) => false
new java.io.File(fn).canWrite() => true
Run Code Online (Sandbox Code Playgroud)

使用JDK 1.7.04

有任何想法吗?

java nio temporary-files writable truezip

5
推荐指数
3
解决办法
3624
查看次数

标签 统计

assembla ×1

git ×1

gitblit ×1

java ×1

jenkins ×1

nio ×1

temporary-files ×1

truezip ×1

windows ×1

writable ×1