@ -39,12 +39,22 @@ public class FILEFactory {
return new FileFILE ( new java . io . File ( path . substring ( FILE_PREFIX . length ( ) ) ) ) ;
} else if ( path . startsWith ( FILE_DATA_PREFIX ) ) {
return new FileDataFILE ( new FileNode ( path . substring ( FILE_DATA_PREFIX . length ( ) ) , false ) , false , path . substring ( FILE_DATA_PREFIX . length ( ) ) ) ;
} else if ( path . startsWith ( FILE_CA_PREFIX ) ) {
return new FileCAFILE ( new FileNode ( path . substring ( FILE_CA_PREFIX . length ( ) ) , false ) , false , path . substring ( FILE_CA_PREFIX . length ( ) ) ) ;
} else {
return new FileNodeFILE ( new FileNode ( path , WorkContext . getWorkResource ( ) . isDirectory ( path ) ) ) ;
}
}
public static FILE createFolder ( String path ) {
return createFolder ( null , path ) ;
}
/ * *
* 传递依据的基础文件并创建文件夹
* /
public static FILE createFolder ( FILE origin , String path ) {
if ( path = = null ) {
return null ;
} else if ( path . startsWith ( MEM_PREFIX ) ) {
@ -58,7 +68,11 @@ public class FILEFactory {
} else if ( path . startsWith ( FILE_PREFIX ) ) {
return new FileFILE ( new java . io . File ( path . substring ( FILE_PREFIX . length ( ) ) ) ) ;
} else if ( path . startsWith ( FILE_DATA_PREFIX ) ) {
return new FileDataFILE ( new FileNode ( path . substring ( FILE_DATA_PREFIX . length ( ) ) , true ) , false , path . substring ( FILE_DATA_PREFIX . length ( ) ) ) ;
FileDataFILE file = new FileDataFILE ( new FileNode ( path . substring ( FILE_DATA_PREFIX . length ( ) ) , true ) , false , path . substring ( FILE_DATA_PREFIX . length ( ) ) ) ;
if ( origin instanceof FileDataFILE ) {
file . setType ( ( ( FileDataFILE ) origin ) . getType ( ) ) ;
}
return file ;
} else if ( path . startsWith ( FILE_CA_PREFIX ) ) {
return new FileCAFILE ( new FileNode ( path . substring ( FILE_CA_PREFIX . length ( ) ) , true ) , false , path . substring ( FILE_CA_PREFIX . length ( ) ) ) ;
}