Subversion Repositories XServices

Rev

Rev 12 | Rev 46 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 12 Rev 14
Line 24... Line 24...
24
import net.brutex.xservices.types.FileSetResource;
24
import net.brutex.xservices.types.FileSetResource;
25
import net.brutex.xservices.types.ResourceInterface;
25
import net.brutex.xservices.types.ResourceInterface;
26
import net.brutex.xservices.types.ReturnCode;
26
import net.brutex.xservices.types.ReturnCode;
27
import net.brutex.xservices.util.RunTask;
27
import net.brutex.xservices.util.RunTask;
28
import org.apache.tools.ant.taskdefs.Basename;
28
import org.apache.tools.ant.taskdefs.Basename;
-
 
29
import org.apache.tools.ant.taskdefs.Chmod;
29
import org.apache.tools.ant.taskdefs.Copy;
30
import org.apache.tools.ant.taskdefs.Copy;
30
import org.apache.tools.ant.taskdefs.Echo;
31
import org.apache.tools.ant.taskdefs.Echo;
31
import org.apache.tools.ant.taskdefs.LoadResource;
32
import org.apache.tools.ant.taskdefs.LoadResource;
32
import org.apache.tools.ant.taskdefs.optional.unix.Chgrp;
33
import org.apache.tools.ant.taskdefs.optional.unix.Chgrp;
33
import org.apache.tools.ant.taskdefs.optional.unix.Chown;
34
import org.apache.tools.ant.taskdefs.optional.unix.Chown;
Line 91... Line 92...
91
    public ReturnCode changeGroup(@WebParam(name = "fileset") FileSetResource res,
92
    public ReturnCode changeGroup(@WebParam(name = "fileset") FileSetResource res,
92
            @WebParam(name = "group") String group) {
93
            @WebParam(name = "group") String group) {
93
        return chgrp(res, group);
94
        return chgrp(res, group);
94
    }
95
    }
Line -... Line 96...
-
 
96
 
-
 
97
    @WebMethod(operationName = "changeMode")
-
 
98
    public ReturnCode changeMode(@WebParam(name="fileset") FileSetResource res,
-
 
99
            @WebParam(name="permissions") String perm) {
-
 
100
        return chmod(res, perm);
-
 
101
    }
95
 
102
 
96
    @WebMethod(exclude = true)
103
    @WebMethod(exclude = true)
97
    private ReturnCode basename(File file,
104
    private ReturnCode basename(File file,
98
            String suffix) {
105
            String suffix) {
99
        Basename basename = new Basename();
106
        Basename basename = new Basename();
Line 162... Line 169...
162
        chown.setTaskName("Chown");
169
        chown.setTaskName("Chown");
163
        RunTask runner = new RunTask(chown);
170
        RunTask runner = new RunTask(chown);
164
        chown.setOwner(owner);
171
        chown.setOwner(owner);
165
        FileSet set = src.getAntFileSet(chown.getProject());
172
        FileSet set = src.getAntFileSet(chown.getProject());
166
        chown.add(set);
173
        chown.add(set);
-
 
174
        chown.setMaxParallel(300);
167
        return runner.postTask();
175
        return runner.postTask();
168
    }
176
    }
Line 169... Line 177...
169
 
177
 
170
    @WebMethod(exclude = true)
178
    @WebMethod(exclude = true)
Line 173... Line 181...
173
        chgrp.setTaskName("Chgrp");
181
        chgrp.setTaskName("Chgrp");
174
        RunTask runner = new RunTask(chgrp);
182
        RunTask runner = new RunTask(chgrp);
175
        chgrp.setGroup(group);
183
        chgrp.setGroup(group);
176
        FileSet set = src.getAntFileSet(chgrp.getProject());
184
        FileSet set = src.getAntFileSet(chgrp.getProject());
177
        chgrp.add(set);
185
        chgrp.add(set);
-
 
186
        chgrp.setMaxParallel(300);
178
        return runner.postTask();
187
        return runner.postTask();
179
    }
188
    }
-
 
189
 
-
 
190
    @WebMethod(exclude = true)
-
 
191
    private ReturnCode chmod(FileSetResource src, String perm) {
-
 
192
        Chmod chmod = new Chmod();
-
 
193
        chmod.setTaskName("Chmod");
-
 
194
        RunTask runner = new RunTask(chmod);
-
 
195
        FileSet set = src.getAntFileSet(chmod.getProject());
-
 
196
        chmod.add(set);
-
 
197
        chmod.setMaxParallel(300);
-
 
198
        chmod.setPerm(perm);
-
 
199
        chmod.setVerbose(true);
-
 
200
        return runner.postTask();
-
 
201
    }
-
 
202
 
180
}
203
}