|
@@ -110,7 +110,7 @@ public class ViewController extends Controller {
|
|
|
public void ttt4() {
|
|
|
try {
|
|
|
DataService dataService = new DataService();
|
|
|
- dataService.downloadFileToFolder("smb://"+ "administrator:"+"Passw0rd@"+"192.168.8.21", "/PACS/sht/20241122/CT/CT161019_CT_101763288_031202", "CT_1.2.840.113619.2.284.3.2831180544.921.1556021108.55.2.dcm", "/home/zskk/SMB_FILE",null);
|
|
|
+ dataService.downloadFileToFolder("smb://"+ "administrator:"+"Passw0rd@"+"192.168.8.21", "/PACS/sht/20241122/CT/CT161019_CT_101763288_031202", "CT_1.2.840.113619.2.284.3.2831180544.921.1556021108.55.2.dcm", "/home/SMB_FILE",null);
|
|
|
} catch (Exception e) {
|
|
|
// TODO: handle exception
|
|
|
this.renderText(e.toString());
|
|
@@ -124,10 +124,15 @@ public class ViewController extends Controller {
|
|
|
try {
|
|
|
SmbFile remoteFile = new SmbFile("smb://administrator:Passw0rd@192.168.8.21/PACS/sht/20241122/CT/CT161019_CT_101763288_031202");
|
|
|
if(remoteFile.exists()){
|
|
|
- File localFile = new File("/home/zskk/SMB_FILE" + File.separator + "CT_1.2.840.113619.2.284.3.2831180544.921.1556021108.55.2.dcm");
|
|
|
+ File localFile = new File("/home/SMB_FILE" + File.separator + "CT_1.2.840.113619.2.284.3.2831180544.921.1556021108.55.2.dcm");
|
|
|
localFile.getParentFile().mkdirs();
|
|
|
in = new BufferedInputStream(new SmbFileInputStream(remoteFile));
|
|
|
out = new BufferedOutputStream(new FileOutputStream(localFile));
|
|
|
+ byte[] buffer = new byte[1024];
|
|
|
+ while (in.read(buffer) != -1) {
|
|
|
+ out.write(buffer);
|
|
|
+ buffer = new byte[1024];
|
|
|
+ }
|
|
|
// SmbFile[] files = remoteFile.listFiles();
|
|
|
// for(SmbFile f : files){
|
|
|
System.out.println(remoteFile.getName());
|
|
@@ -139,7 +144,13 @@ public class ViewController extends Controller {
|
|
|
else {
|
|
|
renderText("");
|
|
|
}
|
|
|
- } catch (MalformedURLException | SmbException | UnknownHostException | FileNotFoundException e) {
|
|
|
+// } catch (MalformedURLException | SmbException e) {
|
|
|
+
|
|
|
+ } catch (MalformedURLException | SmbException | UnknownHostException | FileNotFoundException e) {
|
|
|
+ // TODO Auto-generated catch block
|
|
|
+ e.printStackTrace();
|
|
|
+ renderText(e.toString());
|
|
|
+ } catch (IOException e) {
|
|
|
// TODO Auto-generated catch block
|
|
|
e.printStackTrace();
|
|
|
renderText(e.toString());
|