de.tsl2.nano.core.util.FileUtil.class Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of tsl2.nano.terminal Show documentation
Show all versions of tsl2.nano.terminal Show documentation
TSL2 Framework Terminal (Console Application Framework named SIShell, providing Actions, Options, Commands, Inputs, lots of Selectors, PlatformManagement)
???? 4?
?
B?
?? B??
??
??
????
???
?
??
??
B?
B???
??
?
?
J?
???
?????
???
%??
??
??
??
B?
B?
?
B?
B??
?
0?
??
B???
????
???
;?
B?
;?
??
??
?
B?
??
???
E??
G?
G??
J?
G?
G?
G? ?????
J?
??
J??
??
G?
B???
`?
`
`?
B
B
g?
g
g??
B
?
p?
s?
p
B
?
x?
p
?
!"#
?$
p%
?&
B'
()*+
?,
B-.
B/
?0
?1
2345
67
??
B89:
E;
E?
E?<
??
?=>?
??
?
@A
??
?BC
DEFG
?,
BHI
?J
??
?KLMNOPQ
BRS
?T
BUV
?W
?X
?YZ
??
B[\]
'^_
?,????????
?`ab
Bc
?d ?e
f
ghi
?jk
?l
Bmno
pq
r
st
Bu
vwx
vyz
B{
B|
B}
B~
??
????
s?
????
?
???????
??
??????
B?
B?
0???????????
?
??
??
B?
B?
s? ??
B?
??
??
???
B??
???
??
?
g????
????
??
?3
???
????
?
?????
??
??
???????
B?
??
B???
:??
=??
?????
???
D? B??
G? B??
FileDetail InnerClasses LOG Lorg/apache/commons/logging/Log; DO_DELETE 'Lde/tsl2/nano/core/execution/IRunnable; Signature ILde/tsl2/nano/core/execution/IRunnable; DO_COPY ()V Code LineNumberTable LocalVariableTable this !Lde/tsl2/nano/core/util/FileUtil; getZipInputStream 2(Ljava/lang/String;)Ljava/util/zip/ZipInputStream; e Ljava/io/FileNotFoundException; zipfile Ljava/lang/String; zip Ljava/io/File; fis Ljava/io/FileInputStream;
StackMapTable<??? readFileNamesFromZip 9(Ljava/lang/String;Ljava/lang/String;)[Ljava/lang/String; filter zipStream Ljava/util/zip/ZipInputStream;? F(Ljava/util/zip/ZipInputStream;Ljava/lang/String;Z)[Ljava/lang/String; Ljava/io/IOException; files Ljava/util/List; zipEntry Ljava/util/zip/ZipEntry; ex Ljava/lang/Exception; sourceStream closeStream Z????? getJarInputStream jarName jarStream Ljava/io/InputStream; readFromZip ((Ljava/lang/String;Ljava/lang/String;)[B file 4(Ljava/util/zip/ZipInputStream;Ljava/lang/String;)[B 5(Ljava/util/zip/ZipInputStream;Ljava/lang/String;Z)[B? extractNestedZip H(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/util/List; data [B zipFile destDir regExFilter zipFiles [Ljava/lang/String; extracted LocalVariableTypeTable Ljava/util/List; X(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/util/List; extract 9(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V readBytes ,(Ljava/io/InputStream;Ljava/lang/String;I)[B stream entryName len I b read offset
Exceptions (Ljava/io/InputStream;)[B C(Ljava/io/InputStream;Ljava/io/OutputStream;)Ljava/io/OutputStream; output Ljava/io/OutputStream; r TO; 7(Ljava/io/InputStream;TO;)TO;
writeToZip )(Ljava/lang/String;Ljava/lang/String;[B)V fos Ljava/io/FileOutputStream; targetStream Ljava/util/zip/ZipOutputStream;? getPackagePath &(Ljava/lang/String;)Ljava/lang/String;
classFilePath extensionIndex getFilePath classPath
createPath (Ljava/lang/String;)V fileWithPath parent saveXml /(Ljava/io/Serializable;Ljava/io/OutputStream;)V encoder Ljava/beans/XMLEncoder; serializable Ljava/io/Serializable; outputStream +(Ljava/io/Serializable;Ljava/lang/String;)V fileName? loadXml -(Ljava/io/InputStream;)Ljava/io/Serializable; decoder Ljava/beans/XMLDecoder; inputStream result *(Ljava/lang/String;)Ljava/io/Serializable; loadPropertiesFromFile *(Ljava/lang/String;)Ljava/util/Properties; resourceFile f
properties Ljava/util/Properties; loadProperties A(Ljava/lang/String;Ljava/lang/ClassLoader;)Ljava/util/Properties; classLoader Ljava/lang/ClassLoader; resource*? saveProperties +(Ljava/lang/String;Ljava/util/Properties;)V p hasResource (Ljava/lang/String;)Z name getResource )(Ljava/lang/String;)Ljava/io/InputStream; @(Ljava/lang/String;Ljava/lang/ClassLoader;)Ljava/io/InputStream; saveResourceToFileSystem #(Ljava/net/URL;Ljava/lang/String;)V url Ljava/net/URL; getFile
getFileOutput *(Ljava/lang/String;)Ljava/io/OutputStream; getFileBytes -(Ljava/lang/String;Ljava/lang/ClassLoader;)[B length strFile
writeBytes ([BLjava/lang/String;Z)V append out? userDirFile "(Ljava/lang/String;)Ljava/io/File; load &(Ljava/lang/String;)Ljava/lang/Object; filename l_return Ljava/lang/Object; o Ljava/io/ObjectInputStream;?? save '(Ljava/lang/String;Ljava/lang/Object;)V object Ljava/io/ObjectOutputStream;A getValidFileName
originName getValidPathName getFileData ((Ljava/lang/String;Ljava/lang/String;)[C encoding +(Ljava/io/InputStream;Ljava/lang/String;)[C i [C Ljava/io/InputStreamReader;I getTransformingReader *(Ljava/io/InputStream;CCZ)Ljava/io/Reader; transform C replace ignoreFirstLine %(Ljava/io/Reader;CCZ)Ljava/io/Reader; reader Ljava/io/Reader; copy '(Ljava/lang/String;Ljava/lang/String;)Z f1 f2 srcFile destFile write *(Ljava/io/InputStream;Ljava/lang/String;)J in /(Ljava/io/InputStream;Ljava/io/OutputStream;Z)J closeStreams A(Ljava/io/InputStream;Ljava/io/OutputStream;Ljava/lang/String;Z)J count J
outLogName buf? removeToBackup filePath 9(Ljava/lang/String;Ljava/lang/String;Z)Ljava/lang/String; bakFile backupExtension multiple newName? restoreFrom getHomePath ()Ljava/lang/String; getUniqueFileName baseName iext concat 8(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; dir encodeBase64 bytes base64 decodeBase64
getFileset 6(Ljava/lang/String;Ljava/lang/String;)Ljava/util/List; include F(Ljava/lang/String;Ljava/lang/String;)Ljava/util/List; c(Ljava/lang/String;Ljava/lang/String;Lde/tsl2/nano/core/util/FileUtil$FileDetail;Z)Ljava/util/List; sortBy ,Lde/tsl2/nano/core/util/FileUtil$FileDetail; sortUp s(Ljava/lang/String;Ljava/lang/String;Lde/tsl2/nano/core/util/FileUtil$FileDetail;Z)Ljava/util/List; getTreeFiles basePath
regExFilename 7(Ljava/lang/String;Ljava/lang/String;Z)Ljava/util/List;
caseSensitive G(Ljava/lang/String;Ljava/lang/String;Z)Ljava/util/List; d(Ljava/lang/String;Ljava/lang/String;Lde/tsl2/nano/core/util/FileUtil$FileDetail;ZZ)Ljava/util/List; Ljava/util/LinkedList; &Ljava/util/LinkedList;? t(Ljava/lang/String;Ljava/lang/String;Lde/tsl2/nano/core/util/FileUtil$FileDetail;ZZ)Ljava/util/List; e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/util/Collection;Z)Ljava/util/Collection; path Ljava/util/Collection; [Ljava/io/File; canonPath pattern &Ljava/util/Collection;V? ?(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/util/Collection;Z)Ljava/util/Collection; getFiles 5(Ljava/lang/String;Ljava/lang/String;)[Ljava/io/File; dirPath transformAntToRegEx
antFileFilter forTree a(Ljava/lang/String;Ljava/lang/String;Lde/tsl2/nano/core/execution/IRunnable;)Ljava/lang/Iterable; action :Lde/tsl2/nano/core/execution/IRunnable; ?(Ljava/lang/String;Ljava/lang/String;Lde/tsl2/nano/core/execution/IRunnable;)Ljava/lang/Iterable; w(Ljava/lang/String;Ljava/lang/String;Lde/tsl2/nano/core/execution/IRunnable;Ljava/util/Comparator;)Ljava/lang/Iterable; sorter Ljava/util/Comparator; &Ljava/util/Comparator; Ljava/util/Collection;? ?(Ljava/lang/String;Ljava/lang/String;Lde/tsl2/nano/core/execution/IRunnable;Ljava/util/Comparator;)Ljava/lang/Iterable; forEach o(Ljava/lang/String;Ljava/lang/String;Lde/tsl2/nano/core/execution/IRunnable;[Ljava/lang/Object;)[Ljava/io/File; args [Ljava/lang/Object; ?(Ljava/lang/String;Ljava/lang/String;Lde/tsl2/nano/core/execution/IRunnable;[Ljava/lang/Object;)[Ljava/io/File;
isAbsolute getRelativePath 4(Ljava/io/File;Ljava/lang/String;)Ljava/lang/String; currentPath relpath replaceToJavaSeparator replaceToSystemSeparator
getURIFile pathOrURL getURIFilePath getURLStream
getDetails "(Ljava/io/File;)Ljava/lang/String; decorate prefix Ljava/lang/StringBuilder; postfix close -(Ljava/io/InputStream;Z)Ljava/io/InputStream; forwardException TT; "(TT;Z)TT; /(Ljava/io/OutputStream;Z)Ljava/io/OutputStream; #(TT;Z)TT; #(Ljava/io/Reader;Z)Ljava/io/Reader; (TT;Z)TT; #(Ljava/io/Writer;Z)Ljava/io/Writer; writer Ljava/io/Writer; (TT;Z)TT; deleteRecursive (Ljava/io/File;)Z getChecksum algorithm checksum expectedHash printToFile 2(Ljava/lang/String;Ljava/util/function/Consumer;)V pw Ljava/io/PrintWriter; fw Ljava/io/FileWriter; c Ljava/util/function/Consumer; 4Ljava/util/function/Consumer; I(Ljava/lang/String;Ljava/util/function/Consumer;)V
SourceFile
FileUtil.javaTU????MN java/lang/StringBuilder zip-file ?? not existing!?4??? java/io/FileInputStreamT? java/util/zip/ZipInputStream java/io/BufferedInputStreamT? java/io/FileNotFoundException???[\jp * .*? java/util/LinkedList???4??????U java/lang/String???U java/io/IOException java/lang/RuntimeExceptionT? java/lang/Exception?????? ?????????\ java/util/ArrayList?T??? loading stream-entry with ? bytes?? java/io/ByteArrayOutputStream?? ??
??
? java/io/FileOutputStream java/util/zip/ZipOutputStreamT java/util/zip/ZipEntryT?U? Writing into [ ]: (? / )???? .class ! java/beans/XMLEncoder"??? serializing to xml: ?? java/beans/XMLDecoder#$ java/io/Serializable FileUtil.loadXml from --> %???&? java/util/Properties loading resource: java/io/FileReader?'??() "java/lang/IllegalArgumentException file:
not found??
generated at *+, java/util/Date-. from code /04 by user user.name1?23?4??56$ java/io/InputStream !de/tsl2/nano/core/util/FileUtil$1T7" Try to open File ??8?9:;< java/lang/IllegalAccessException 4not all bytes were read from stream! The InputStream?= % should not be read with this method!?? writing into file T> java/io/File? deserializing object from: java/io/ObjectInputStream serializing object to file: java/io/ObjectOutputStream [^a-zA-Z0-9-._] _@9 [^a-zA-Z0-9-/._]
reading file !de/tsl2/nano/core/util/FileUtil$2
java/io/InputStreamReaderTA?B stream.available(): bytes, but only $ bytes read -> filling rest with ' ' read from stream not all bytes ( 4 bytes left) were read from stream! The InputStream ?? java/io/BufferedReaderT' !de/tsl2/nano/core/util/FileUtil$3TCD?E4 /$ file copied to F4 !de/tsl2/nano/core/util/FileUtil$4G written to .bak*,H?I`J?KL4 M? couldn't delete bak file:N?2 couldn't delete file: user.homeOP - QR S??T;U .base64>U .base64decoded?C`?HNHS %de/tsl2/nano/core/util/FileComparatorTVWXY fileset( --> ?Z[\ ' ' is not a directory]4^4 \Q \E? !de/tsl2/nano/core/util/FileUtil$5[_ **/ ** ([^.])\* $1.*bg?@`a?b?c$ java/lang/Objectdef !de/tsl2/nano/core/util/FileUtil$8Tgh? :ij user.dirt9x? kl|?mnop4q}?
name : ?
path : r4
modified: sTtu.
access : wv? x
size : ?w [ ]x? < >yz can't close inputstream {|} can't close writer can't be deleted! deleting sub-directories/files of ...??~??9 java/lang/IllegalStateException <: file hash error. file seems to be corrupt (expected hash: java/io/FileWriter java/io/PrintWriterT???? de/tsl2/nano/core/util/FileUtil??? !de/tsl2/nano/core/util/FileUtil$6OP !de/tsl2/nano/core/util/FileUtil$7SP *de/tsl2/nano/core/util/FileUtil$FileDetail java/util/List java/lang/Throwable java/io/OutputStream java/lang/ClassLoader org/apache/commons/logging/Log java/util/Collection java/util/Iterator exists ()Z -(Ljava/lang/String;)Ljava/lang/StringBuilder; toString warn (Ljava/lang/Object;)V (Ljava/io/File;)V (Ljava/io/InputStream;)V "de/tsl2/nano/core/ManagedException forward ,(Ljava/lang/Throwable;)Ljava/lang/Throwable; D(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String; getNextEntry ()Ljava/util/zip/ZipEntry; getName matches add (Ljava/lang/Object;)Z
closeEntry toArray (([Ljava/lang/Object;)[Ljava/lang/Object; (Ljava/lang/Throwable;)V java/lang/Thread
currentThread ()Ljava/lang/Thread; getContextClassLoader ()Ljava/lang/ClassLoader; getResourceAsStream equals ()I (I)V mkdirs (I)Ljava/lang/StringBuilder; debug ([BII)I toByteArray ()[B getBytes
getParentFile ()Ljava/io/File;
createNewFile (Ljava/io/OutputStream;)V setMethod putNextEntry (Ljava/util/zip/ZipEntry;)V ([B)V flush java/lang/System Ljava/io/PrintStream; getCompressedSize ()J (J)Ljava/lang/StringBuilder; getSize java/io/PrintStream println error (CC)Ljava/lang/String; indexOf (Ljava/lang/String;)I substring (II)Ljava/lang/String; writeObject
readObject ()Ljava/lang/Object; info canRead (Ljava/io/Reader;)V setContextClassLoader (Ljava/lang/ClassLoader;)V java/text/DateFormat getDateTimeInstance ()Ljava/text/DateFormat; format $(Ljava/util/Date;)Ljava/lang/String; %de/tsl2/nano/core/util/ConcurrentUtil getCaller getProperty store +(Ljava/io/OutputStream;Ljava/lang/String;)V "(Ljava/lang/String;)Ljava/net/URL; java/net/URL
getContent #(Ljava/io/File;Ljava/lang/String;)V available ([B)I de/tsl2/nano/core/util/ByteUtil amount (J)Ljava/lang/String; -(Ljava/lang/Object;)Ljava/lang/StringBuilder; (Ljava/io/File;Z)V getAbsoluteFile
replaceAll *(Ljava/io/InputStream;Ljava/lang/String;)V ([C)I (Ljava/io/Reader;ZCC)V isDirectory getPath
getMessage ([BII)V canWrite separator endsWith de/tsl2/nano/core/util/DateUtil getFormattedTimeStamp delete renameTo lastIndexOf (I)I (I)Ljava/lang/String; !de/tsl2/nano/core/util/StringUtil K(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Z)Ljava/lang/String; &org/apache/commons/codec/binary/Base64 ([B)[B 0(Lde/tsl2/nano/core/util/FileUtil$FileDetail;Z)V java/util/Collections sort )(Ljava/util/List;Ljava/util/Comparator;)V '(Ljava/lang/Object;I)Ljava/lang/String; listFiles ()[Ljava/io/File; toLowerCase getCanonicalPath )(Ljava/io/FilenameFilter;)[Ljava/io/File; iterator ()Ljava/util/Iterator; hasNext next %de/tsl2/nano/core/execution/IRunnable run 9(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; O(Ljava/lang/String;Lde/tsl2/nano/core/execution/IRunnable;[Ljava/lang/Object;)V
startsWith contains (Ljava/lang/CharSequence;)Z J(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
separatorChar java/net/URI create "(Ljava/lang/String;)Ljava/net/URI; getSchemeSpecificPart de/tsl2/nano/core/util/NetUtil getParent lastModified (J)V getFormattedDateTime
canExecute de/tsl2/nano/core/util/BitUtil isHidden insert .(ILjava/lang/String;)Ljava/lang/StringBuilder; *(Ljava/lang/Object;Ljava/lang/Throwable;)V java/io/Reader java/io/Writer de/tsl2/nano/core/secure/Crypt hashHex ;(Ljava/io/InputStream;Ljava/lang/String;)Ljava/lang/String; (Ljava/io/Writer;)V java/util/function/Consumer accept de/tsl2/nano/core/log/LogFactory getLog 3(Ljava/lang/Class;)Lorg/apache/commons/logging/Log; !B MN OP Q R SP Q R W TU V / *? ? W CX YZ
[\ V ? Q*? L+? ? %? ? Y? ? *? ? ?
? ?M? Y+?
M? Y? Y,? ? ?N-? W? 0 H I W *
M N O , P . S 0 U 9 V I W J X O YX * J ]^ Q_` Lab 0 !cd e ? .f? gfh i jk V h *? M,? ,+? ? ? W
e fX _` l` mn e ? o@ " jp V ? ?+? +? ? L? Y? N:*? Y:? &? +? ? -? ? W???*? ???-? ? ! ? "? ":*? ? *? #? :? %Y? &??N? %Y-? &?:*? ? *? #? :? %Y? &?? d h k $ \ z ' \ ? ? ? ? $ z ? ? W ^ k o p q ' r 3 s ? u C v J y \ } d h ? k ? m ? w y z z { { ? } ? ? ? ? ? ? ? ? ?X R m
]q `rs ]tu { vw ?
]q ?xn ?l` ?yz e [ Ag? {|!
? og{| " }? og ~I? og } ?\ V \ ? (? )*? *L? Y+? M,? W ? ? ?X ?` ?? mn ?? V = *? +? +? W ?X _` ?` ?? V ; *+? ,? W ?X xn ?` ?? V &