我有这个问题,我正在创建一个文件,但这是创建空文件.
我使用的是Dropbox的API,Dropbox的代码运行良好,但我不知道我不好.我已经为我的应用程序使用了2º和3º代码,这是运行良好.
这通过分层次操作.我正在发送outputStream用于功能.但这是空的.
我正在使用outputStream,因为我需要它与outputstream一起运行.
1º代码(Class Test || Call):
File tempFile=new File("C:\PRUEBAS_TFG\cloud.png"); if ( ! ists() ) { ateNewFile(); }
File file = new File("C:\PRUEBAS_TFG\cloud.png");
OutputStream outputStream = new FileOutputStream(file);
catmanager.AllListCatalog().get(0), AllListCatalog().get(0).getItems().get(2), listFile, outputStream);
outputStream.close();
2ºCode(Class catmanager ||1ºbody):
public void downloadFilesToItem(Catalog catalog, Item item, List files, OutputStream output){
try{
String fsPath;
fsPath = pathCatalog(catalog);
getFSManager().changeDirectoryConfigNPath(fsPath+"/"Name()+"_item");
for(int i = 0;i
getFSManager().(i), output);
}
}catch(Exception e){
e.printStackTrace();
}
}
3ºCode(FSManager类||2ºbody)
public void downloadFile(String fileName, OutputStream output) throws IOException{//Aqui deveria Buscar el Fichero Funciona por que da la casualidad que esta el fichero en la primera nube
/** Cogemos la lista de FS del usuario */
List aux = getFileSystemsUser();
for(int i = 0; i < aux.size();i++){
/** Se realiza la Funcionalidad del metodo*/
System.out.(i).toString());
try{
<(i).downloadFile(_(i)+"/"+fileName, output);i = aux.size()+1;
}catch(IOException e) {
}
}
}
4ºCode(Class aux Dropbox || API Dropbox):
public void downloadFile(String fileName, OutputStream aux) throws IOException{
try{
getDbxClient().getFile(fileName, null, aux);
}catch(IOException e){
throw e;
}catch(DbxException u){
throw new Cause());
}
}
谢谢提前.
本文发布于:2024-01-31 05:51:09,感谢您对本站的认可!
本文链接:https://www.4u4v.net/it/170665147226007.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
留言与评论(共有 0 条评论) |