Skip to content

Commit e064f1f

Browse files
committed
0.8.6-jvfs4 (2023-01-20)
+ Added db script for daogen jfile mount + Added JFileUtilCP (copy) + Added JFileUtilRM (delete)
1 parent cb61064 commit e064f1f

File tree

17 files changed

+232
-330
lines changed

17 files changed

+232
-330
lines changed

fj-core/src/main/java/org/fugerit/java/core/jvfs/JFile.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import java.io.OutputStream;
66
import java.io.Reader;
77
import java.io.Writer;
8+
import java.util.List;
89

910
public interface JFile {
1011

@@ -24,6 +25,8 @@ public interface JFile {
2425

2526
public JFile[] listFiles() throws IOException;
2627

28+
public List<JFile> lsFiles() throws IOException;
29+
2730
public boolean delete() throws IOException;
2831

2932
public boolean create() throws IOException;
@@ -58,4 +61,6 @@ public interface JFile {
5861

5962
public void setLastModified(long time) throws IOException;
6063

64+
public String describe();
65+
6166
}
Lines changed: 0 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,9 @@
1-
/****************************************************************
2-
<copyright>
3-
Morozko Java Library org.morozko.java.core
4-
5-
Copyright (c) 2006 Morozko
6-
7-
All rights reserved. This program and the accompanying materials
8-
are made available under the terms of the Apache License v2.0
9-
which accompanies this distribution, and is available at
10-
http://www.apache.org/licenses/
11-
(txt version : http://www.apache.org/licenses/LICENSE-2.0.txt
12-
html version : http://www.apache.org/licenses/LICENSE-2.0.html)
13-
14-
This product includes software developed at
15-
The Apache Software Foundation (http://www.apache.org/).
16-
</copyright>
17-
*****************************************************************/
18-
/*
19-
* @(#)JFileFun.java
20-
*
21-
* @project : org.morozko.java.core
22-
* @package : org.morozko.java.core.jvfs
23-
* @creation : 16-gen-2005 15.33.52
24-
* @release : xxxx.xx.xx
25-
*/
261
package org.fugerit.java.core.jvfs;
272

283
import java.io.IOException;
294

30-
/*
31-
* <p>
32-
* <jdl:section>
33-
* <jdl:text lang='it'>
34-
* Funzione che esegue delle manipolzaione a partire da un file.
35-
* </jdl:text>
36-
* <jdl:text lang='en'>
37-
* Function for manipulating files.
38-
* </jdl:text>
39-
* </jdl:section>
40-
* </p>
41-
*
42-
* @author Morozko
43-
*
44-
*/
455
public interface JFileFun {
466

47-
/*
48-
* <p>
49-
* <jdl:section>
50-
* <jdl:text lang='it'>Esegue delle operazioni a partire da un file.</jdl:text>
51-
* <jdl:text lang='en'>Does operations starting from a file.</jdl:text>
52-
* </jdl:section>
53-
* </p>
54-
*
55-
* @param file <jdl:section>
56-
* <jdl:text lang='it'>Il file in questione.</jdl:text>
57-
* <jdl:text lang='en'>The file.</jdl:text>
58-
* </jdl:section>
59-
* @throws IOException <jdl:section>
60-
* <jdl:text lang='it'>Se qualcosa va male durante l'elaborazione.</jdl:text>
61-
* <jdl:text lang='en'>If something goes wrong during elaboration.</jdl:text>
62-
* </jdl:section>
63-
*/
647
public void handle(JFile file) throws IOException;
658

669
}
Lines changed: 0 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,7 @@
1-
/****************************************************************
2-
<copyright>
3-
Morozko Java Library org.morozko.java.core
4-
5-
Copyright (c) 2006 Morozko
6-
7-
All rights reserved. This program and the accompanying materials
8-
are made available under the terms of the Apache License v2.0
9-
which accompanies this distribution, and is available at
10-
http://www.apache.org/licenses/
11-
(txt version : http://www.apache.org/licenses/LICENSE-2.0.txt
12-
html version : http://www.apache.org/licenses/LICENSE-2.0.html)
13-
14-
This product includes software developed at
15-
The Apache Software Foundation (http://www.apache.org/).
16-
</copyright>
17-
*****************************************************************/
18-
/*
19-
* @(#)JMountPoint.java
20-
*
21-
* @project : org.morozko.java.core
22-
* @package : org.morozko.java.core.jvfs
23-
* @creation : 9-dic-2004 14.10.26
24-
* @release : xxxx.xx.xx
25-
*/
261
package org.fugerit.java.core.jvfs;
272

283
import java.util.Properties;
294

30-
/*
31-
* <p>
32-
* <jdl:section>
33-
* <jdl:text lang='it'>
34-
* Classe che mangiene le informazioni necessarie alla gestione
35-
* di un punto di mount.
36-
* </jdl:text>
37-
* <jdl:text lang='en'>
38-
* Class helding the necessary information for handling
39-
* a mount point.
40-
* </jdl:text>
41-
* </jdl:section>
42-
* </p>
43-
*
44-
* @author Morozko
45-
*
46-
*/
475
public class JMountPoint {
486

497
private Properties options; // mount options
@@ -55,82 +13,22 @@ public class JMountPoint {
5513
public String toString() {
5614
return this.getMount().toString()+" "+this.getPoint();
5715
}
58-
59-
/*
60-
* <jdl:section>
61-
* <jdl:text lang='it'><p>Crea una nuova istanza di JMountPoint.</p></jdl:text>
62-
* <jdl:text lang='en'><p>Creates a new instance of JMountPoint.</p></jdl:text>
63-
* </jdl:section>
64-
*
65-
* @param mount <jdl:section>
66-
* <jdl:text lang='it'>Il gestore di mount.</jdl:text>
67-
* <jdl:text lang='en'>The mount handler.</jdl:text>
68-
* </jdl:section>
69-
* @param point <jdl:section>
70-
* <jdl:text lang='it'>Il punto di mount.</jdl:text>
71-
* <jdl:text lang='en'>The mount point.</jdl:text>
72-
* </jdl:section>
73-
* @param options <jdl:section>
74-
* <jdl:text lang='it'>Opzioni di mount.</jdl:text>
75-
* <jdl:text lang='en'>Mount options.</jdl:text>
76-
* </jdl:section>
77-
*/
7816
public JMountPoint(JMount mount, String point, Properties options) {
7917
this.mount = mount;
8018
this.point = point;
8119
this.options = options;
8220
}
8321

84-
/*
85-
* <p>
86-
* <jdl:section>
87-
* <jdl:text lang='it'>Restituisce il valore del campo mount.</jdl:text>
88-
* <jdl:text lang='en'>Returns the value of mount.</jdl:text>
89-
* </jdl:section>
90-
* </p>
91-
*
92-
* @return <jdl:section>
93-
* <jdl:text lang='it'>il valore del campo mount.</jdl:text>
94-
* <jdl:text lang='en'>the value of mount.</jdl:text>
95-
* </jdl:section>
96-
*/
9722
public JMount getMount() {
9823
return mount;
9924
}
10025

101-
/*
102-
* <p>
103-
* <jdl:section>
104-
* <jdl:text lang='it'>Restituisce il valore del campo options.</jdl:text>
105-
* <jdl:text lang='en'>Returns the value of options.</jdl:text>
106-
* </jdl:section>
107-
* </p>
108-
*
109-
* @return <jdl:section>
110-
* <jdl:text lang='it'>il valore del campo options.</jdl:text>
111-
* <jdl:text lang='en'>the value of options.</jdl:text>
112-
* </jdl:section>
113-
*/
11426
public Properties getOptions() {
11527
return options;
11628
}
11729

118-
/*
119-
* <p>
120-
* <jdl:section>
121-
* <jdl:text lang='it'>Restituisce il valore del campo point.</jdl:text>
122-
* <jdl:text lang='en'>Returns the value of point.</jdl:text>
123-
* </jdl:section>
124-
* </p>
125-
*
126-
* @return <jdl:section>
127-
* <jdl:text lang='it'>il valore del campo point.</jdl:text>
128-
* <jdl:text lang='en'>the value of point.</jdl:text>
129-
* </jdl:section>
130-
*/
13130
public String getPoint() {
13231
return point;
13332
}
13433

135-
13634
}

fj-core/src/main/java/org/fugerit/java/core/jvfs/db/JMountDaogenDB.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,13 @@ public JFile[] listFiles( DaogenJFileDB file ) throws IOException {
127127
list = res.getList().stream().map(
128128
dbf -> new DaogenJFileDB( JFileUtils.createPath( this.checkParentPath( dbf.getParentPath() ), dbf.getFileName() ), file.getJVFS(), dbf, this )
129129
).collect( Collectors.toList() ).toArray( new JFile[0] );
130+
} else if ( res.getResultCode() == BasicDaoResult.RESULT_NODATAFOUND ) {
131+
list = new JFile[0];
130132
} else {
131133
throw new DAOException( "Failed to created listing : "+res );
132134
}
133135
} catch (Exception e) {
134-
throw new IOException( "Failed to created directory listing : "+file );
136+
throw new IOException( "Failed to created directory listing : "+file, e );
135137
}
136138
return list;
137139
}

fj-core/src/main/java/org/fugerit/java/core/jvfs/fun/JFileFunResult.java

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,9 @@
1-
/****************************************************************
2-
<copyright>
3-
Morozko Java Library org.morozko.java.core
4-
5-
Copyright (c) 2006 Morozko
6-
7-
All rights reserved. This program and the accompanying materials
8-
are made available under the terms of the Apache License v2.0
9-
which accompanies this distribution, and is available at
10-
http://www.apache.org/licenses/
11-
(txt version : http://www.apache.org/licenses/LICENSE-2.0.txt
12-
html version : http://www.apache.org/licenses/LICENSE-2.0.html)
13-
14-
This product includes software developed at
15-
The Apache Software Foundation (http://www.apache.org/).
16-
</copyright>
17-
*****************************************************************/
18-
/*
19-
* @(#)JFileFunResult.java
20-
*
21-
* @project : org.morozko.java.core
22-
* @package : org.morozko.java.core.jvfs.fun
23-
* @creation : 17-gen-2005 0.16.50
24-
* @release : xxxx.xx.xx
25-
*/
261
package org.fugerit.java.core.jvfs.fun;
272

283
import org.fugerit.java.core.jvfs.JFileFun;
294
import org.fugerit.java.core.lang.helpers.Result;
305
import org.fugerit.java.core.lang.helpers.ResultExHandler;
316

32-
/*
33-
*
34-
* <p>
35-
* <jdl:section>
36-
* <jdl:text lang='it'>
37-
*
38-
* </jdl:text>
39-
* <jdl:text lang='en'>
40-
* </jdl:text>
41-
* </jdl:section>
42-
* </p>
43-
*
44-
* @author Morozko
45-
*
46-
*/
477
public class JFileFunResult extends JFileFunSafe {
488

499
private Result result;
@@ -57,11 +17,6 @@ public JFileFunResult(JFileFun fileFun, Result result) {
5717
this.result = result;
5818
}
5919

60-
/*
61-
* <p>Restituisce il valore di result.</p>
62-
*
63-
* @return il valore di result.
64-
*/
6520
public Result getResult() {
6621
return result;
6722
}

fj-core/src/main/java/org/fugerit/java/core/jvfs/fun/JFileFunSafe.java

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,3 @@
1-
/****************************************************************
2-
<copyright>
3-
Morozko Java Library org.morozko.java.core
4-
5-
Copyright (c) 2006 Morozko
6-
7-
All rights reserved. This program and the accompanying materials
8-
are made available under the terms of the Apache License v2.0
9-
which accompanies this distribution, and is available at
10-
http://www.apache.org/licenses/
11-
(txt version : http://www.apache.org/licenses/LICENSE-2.0.txt
12-
html version : http://www.apache.org/licenses/LICENSE-2.0.html)
13-
14-
This product includes software developed at
15-
The Apache Software Foundation (http://www.apache.org/).
16-
</copyright>
17-
*****************************************************************/
18-
/*
19-
* @(#)JFileFunSafe.java
20-
*
21-
* @project : org.morozko.java.core
22-
* @package : org.morozko.java.core.jvfs.fun
23-
* @creation : 17-gen-2005 0.13.57
24-
* @release : xxxx.xx.xx
25-
*/
261
package org.fugerit.java.core.jvfs.fun;
272

283
import java.io.IOException;
@@ -31,28 +6,15 @@ The Apache Software Foundation (http://www.apache.org/).
316
import org.fugerit.java.core.jvfs.JFileFun;
327
import org.fugerit.java.core.lang.helpers.ExHandler;
338

34-
/*
35-
* <p></p>
36-
*
37-
* @author Matteo Franci aka TUX2
38-
*/
399
public class JFileFunSafe extends JFileFunWrapper {
4010

4111
private ExHandler handler;
4212

43-
/*
44-
* <p>Crea un nuovo JFileFunSafe</p>
45-
*
46-
* @param fileFun
47-
*/
4813
public JFileFunSafe(JFileFun fileFun, ExHandler handler) {
4914
super(fileFun);
5015
this.handler = handler;
5116
}
5217

53-
/* (non-Javadoc)
54-
* @see org.morozko.java.core.jvfs.JFileFun#handle(org.morozko.java.core.jvfs.JFile)
55-
*/
5618
public void handle(JFile file) throws IOException {
5719
try {
5820
super.handle(file);

0 commit comments

Comments
 (0)