2016-02-11 30 views
1

我想在Jimfs文件系統中創建一個目錄(使用ceylon的文件模塊),但我在從錫蘭訪問文件系統時沒有安裝Jimfs提供程序時遇到問題。Jimfs到錫蘭的路徑目錄

這是我的測試程序:

// File: test.se.gustavkarlsson.autogit.file.watcher.run 

import ceylon.file { 
    Nil, 
    parseURI 
} 

import com.google.common.jimfs { 
    Jimfs { 
     jimFs=newFileSystem 
    } 
} 

shared void run() { 
    value fs = jimFs(); 
    value jPath = fs.getPath("directory"); 
    value uri = jPath.toUri().string; 
    value path = parseURI(uri); 
    value resource = path.resource; 
    assert (is Nil resource); 
    resource.createDirectory(); 
} 

運行時,打印以下堆棧跟蹤:

ceylon run: Provider "jimfs" not found 
java.nio.file.ProviderNotFoundException: Provider "jimfs" not found 
    at java.nio.file.FileSystems.newFileSystem(FileSystems.java:341) 
    at java.nio.file.FileSystems.newFileSystem(FileSystems.java:276) 
    at ceylon.file.internal.createSystem_.createSystem(ConcreteSystem.ceylon:64) 
    at ceylon.file.createSystem_.createSystem(System.ceylon:43) 
    at test.se.gustavkarlsson.autogit.file.watcher.run_.run(run.ceylon:17) 
    at test.se.gustavkarlsson.autogit.file.watcher.run_.main(run.ceylon) 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
    at java.lang.reflect.Method.invoke(Method.java:498) 
    at ceylon.modules.api.runtime.SecurityActions.invokeRunInternal(SecurityActions.java:57) 
    at ceylon.modules.api.runtime.SecurityActions.invokeRun(SecurityActions.java:48) 
    at ceylon.modules.api.runtime.AbstractRuntime.invokeRun(AbstractRuntime.java:75) 
    at ceylon.modules.api.runtime.AbstractRuntime.execute(AbstractRuntime.java:122) 
    at ceylon.modules.api.runtime.AbstractRuntime.execute(AbstractRuntime.java:106) 
    at ceylon.modules.Main.execute(Main.java:69) 
    at ceylon.modules.Main.main(Main.java:42) 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
    at java.lang.reflect.Method.invoke(Method.java:498) 
    at org.jboss.modules.Module.run(Module.java:312) 
    at org.jboss.modules.Main.main(Main.java:460) 
    at ceylon.modules.bootstrap.CeylonRunTool.run(CeylonRunTool.java:244) 
    at com.redhat.ceylon.common.tools.CeylonTool.run(CeylonTool.java:491) 
    at com.redhat.ceylon.common.tools.CeylonTool.execute(CeylonTool.java:380) 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
    at java.lang.reflect.Method.invoke(Method.java:498) 
    at com.redhat.ceylon.launcher.Launcher.runInJava7Checked(Launcher.java:114) 
    at com.redhat.ceylon.launcher.Launcher.run(Launcher.java:41) 
    at com.redhat.ceylon.launcher.Launcher.run(Launcher.java:34) 
    at com.redhat.ceylon.launcher.Launcher.main(Launcher.java:27) 

關於如何安裝該提供任何想法?

我在Linux上運行Ceylon 1.2.0,使用JimFs 1.0(也測試過1.1-rc1)並且使用Jimfs的「預期」方式(純java nio)可以正常工作。

回答