1084
|
1 |
"{ Package: 'stx:goodies/monticello' }"
|
|
2 |
|
|
3 |
"{ NameSpace: Smalltalk }"
|
|
4 |
|
|
5 |
Object subclass:#MCFileTreeFileUtils
|
|
6 |
instanceVariableNames:''
|
|
7 |
classVariableNames:'Current'
|
|
8 |
poolDictionaries:''
|
|
9 |
category:'SCM-Monticello-FileTree-Core'
|
|
10 |
!
|
|
11 |
|
|
12 |
MCFileTreeFileUtils comment:'Utility class for file access'
|
|
13 |
!
|
|
14 |
|
|
15 |
|
|
16 |
!MCFileTreeFileUtils class methodsFor:'initialization'!
|
|
17 |
|
|
18 |
install
|
|
19 |
Current := self
|
|
20 |
! !
|
|
21 |
|
|
22 |
!MCFileTreeFileUtils class methodsFor:'accessing'!
|
|
23 |
|
|
24 |
current
|
|
25 |
^ Current
|
|
26 |
! !
|
|
27 |
|
|
28 |
!MCFileTreeFileUtils class methodsFor:'utilities'!
|
|
29 |
|
|
30 |
buildPathFrom: pathCollection
|
|
31 |
^ String
|
|
32 |
streamContents: [ :stream | pathCollection do: [ :element | stream nextPutAll: element ] separatedBy: [ stream nextPut: self pathNameDelimiter ] ]
|
|
33 |
!
|
|
34 |
|
|
35 |
default
|
|
36 |
self subclassResponsibility
|
|
37 |
!
|
|
38 |
|
|
39 |
deleteAll: aDirectory
|
|
40 |
self subclassResponsibility
|
|
41 |
!
|
|
42 |
|
|
43 |
directoryExists: aDirectory
|
|
44 |
self subclassResponsibility
|
|
45 |
!
|
|
46 |
|
|
47 |
directoryFromPath: directoryPath
|
|
48 |
self subclassResponsibility
|
|
49 |
!
|
|
50 |
|
|
51 |
directoryFromPath: directoryPath relativeTo: aDirectory
|
|
52 |
self subclassResponsibility
|
|
53 |
!
|
|
54 |
|
|
55 |
directoryName: aDirectory
|
|
56 |
self subclassResponsibility
|
|
57 |
!
|
|
58 |
|
|
59 |
directoryPathString: aDirectory
|
|
60 |
self subclassResponsibility
|
|
61 |
!
|
|
62 |
|
|
63 |
ensureDirectoryExists: aDirectory
|
|
64 |
self subclassResponsibility
|
|
65 |
!
|
|
66 |
|
|
67 |
ensureFilePathExists: fileNameOrPath relativeTo: aDirectory
|
|
68 |
self subclassResponsibility
|
|
69 |
!
|
|
70 |
|
|
71 |
filePathExists: filePath relativeTo: aDirectory
|
|
72 |
self subclassResponsibility
|
|
73 |
!
|
|
74 |
|
|
75 |
parentDirectoryOf: aDirectory
|
|
76 |
self subclassResponsibility
|
|
77 |
!
|
|
78 |
|
|
79 |
pathNameDelimiter
|
|
80 |
self subclassResponsibility
|
|
81 |
!
|
|
82 |
|
|
83 |
readStreamFor: filePath in: aDirectory do: aBlock
|
|
84 |
self subclassResponsibility
|
|
85 |
!
|
|
86 |
|
|
87 |
resolvePath: path in: aDirectory
|
|
88 |
self subclassResponsibility
|
|
89 |
!
|
|
90 |
|
|
91 |
writeStreamFor: filePath in: aDirectory do: aBlock
|
|
92 |
self subclassResponsibility
|
|
93 |
! !
|
|
94 |
|
|
95 |
!MCFileTreeFileUtils class methodsFor:'documentation'!
|
|
96 |
|
|
97 |
version_CVS
|
|
98 |
^ '$Header$'
|
|
99 |
! !
|
|
100 |
|