雅皮...我得到了解決方案....
POI使用以下方法創建臨時文件。
public static File createTempFile(String prefix, String suffix)
{
if (dir == null) {
dir = new File(System.getProperty("java.io.tmpdir"), "poifiles");
dir.mkdir();
if (System.getProperty("poi.keep.tmp.files") == null) {
dir.deleteOnExit();
}
}
File newFile = new File(dir, prefix + rnd.nextInt() + suffix);
if (System.getProperty("poi.keep.tmp.files") == null) {
newFile.deleteOnExit();
}
return newFile;
}
現在這裏,我們可以看到它的財產「java.io.tmpdir」獲取地址,並創建內部的poifiles目錄...
我改變java.io.tmpdir的位置由設置這個屬性(使用System.setProperty(「java.io.tmpdir」,「somepath」))到用戶特定的位置......和Voila ....每個用戶現在可以創建臨時文件在他們始終可訪問的位置,而不僅僅是第一個用戶獲得創建只能訪問他的目錄的權限...... !!!