1. /*
  2. * Copyright 2001-2002,2004 The Apache Software Foundation
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. *
  16. */
  17. package org.apache.tools.ant.taskdefs.optional.ide;
  18. import java.io.File;
  19. /**
  20. * A Remote Access to Tools Servlet to import a Project
  21. * from files into the Repository. The following
  22. * table describes the servlet parameters.
  23. *
  24. * <table>
  25. * <tr>
  26. * <td>Parameter</td>
  27. * <td>Description</td>
  28. * </tr>
  29. * <tr>
  30. * <td>project</td>
  31. * <td>The name of the project where you want the imported
  32. * items to go.
  33. * </td>
  34. * </tr>
  35. * <tr>
  36. * <td>dir</td>
  37. * <td>The directory you want to import from.</td>
  38. * </tr>
  39. * </table>
  40. *
  41. */
  42. public class VAJImportServlet extends VAJToolsServlet {
  43. /**
  44. * Respond to a request to import files to the Repository
  45. */
  46. protected void executeRequest() {
  47. getUtil().importFiles(
  48. getFirstParamValueString(PROJECT_NAME_PARAM),
  49. new File(getFirstParamValueString(DIR_PARAM)),
  50. getParamValues(INCLUDE_PARAM),
  51. getParamValues(EXCLUDE_PARAM),
  52. getBooleanParam(CLASSES_PARAM, false),
  53. getBooleanParam(RESOURCES_PARAM, true),
  54. getBooleanParam(SOURCES_PARAM, true),
  55. false);
  56. // no default excludes, because they
  57. // are already added on client side
  58. // getBooleanParam(DEFAULT_EXCLUDES_PARAM, true)
  59. }
  60. }