gfs目录获取和复制

glusterfs-api
chenlw 9 years ago
parent e0860af5fc
commit 5bd29da12e

@ -4,11 +4,15 @@
<classpathentry kind="src" path="test"/> <classpathentry kind="src" path="test"/>
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/> <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/> <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
<classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/MyEclipse Tomcat v7.0">
<attributes>
<attribute name="owner.project.facets" value="jst.web;#system#"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
<attributes> <attributes>
<attribute name="owner.project.facets" value="java"/> <attribute name="owner.project.facets" value="java"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/MyEclipse Tomcat v7.0"/>
<classpathentry kind="output" path="build/classes"/> <classpathentry kind="output" path="build/classes"/>
</classpath> </classpath>

@ -1,2 +1,3 @@
eclipse.preferences.version=1 eclipse.preferences.version=1
performed.operation.correct.unbound.jre=1.0 performed.operation.correct.unbound.jre=1.0
performed.operation.resolve.unknown.runtime=1.0

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<faceted-project> <faceted-project>
<runtime name="Apache Tomcat v7.0"/> <runtime name="MyEclipse Tomcat v7.0"/>
<fixed facet="java"/> <fixed facet="java"/>
<fixed facet="wst.jsdt.web"/> <fixed facet="wst.jsdt.web"/>
<fixed facet="jst.web"/> <fixed facet="jst.web"/>

@ -11,6 +11,7 @@ import com.platform.utils.Configs;
@Controller @Controller
public class DefaultController { public class DefaultController {
@RequestMapping("/") @RequestMapping("/")
public ModelAndView defaultHandler(HttpServletRequest req, HttpServletResponse res){ public ModelAndView defaultHandler(HttpServletRequest req, HttpServletResponse res){
//处理不匹配的请求 //处理不匹配的请求

@ -1,35 +1,50 @@
/**
* : FolderController.java
* : </>
* : <>
* @author chen
* : <>
* 201698
* <>
*/
package com.platform.controller; package com.platform.controller;
import javax.annotation.Resource;
import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestMapping;
import com.base.BaseController; import com.base.BaseController;
import com.base.CustomException;
import com.platform.entities.GfsFolderEntity;
import com.platform.service.IGfsService;
/** /**
* <> * <>
* <> * <>
* @author chen * @author chen
* @version [201698] * @version [201698]
* @see [/] * @see [/]
* @since [/] * @since [/]
*/ */
@Controller
@RequestMapping("/folder")
public class FolderController extends BaseController { public class FolderController extends BaseController {
/** @Resource(name = "gfsService")
* <> private IGfsService gfsService;
* <>
* @see [##] @RequestMapping("/getAllSubPathByPath")
*/ public Object getAllSubPathByPath(String path) throws CustomException {
public FolderController() { System.out.println(path);
// TODO Auto-generated constructor stub Object result = null;
if (null != path && !"".equals(path)) {
System.out.println(path);
result = gfsService.getFolder(path);
throw new CustomException("3211", null);
}
return result;
} }
@RequestMapping("/moveFolder")
public Object moveFolder(String srcpath, String dstPath) {
System.out.println(srcpath);
System.out.println(dstPath);
return null;
}
} }

@ -0,0 +1,77 @@
/**
* : GfsPathModel.java
* : </>
* : <>
* @author chen
* : <>
* 201698
* <>
*/
package com.platform.entities;
import java.util.List;
/**
* <>
* <>
* @author chen
* @version [201698]
* @see [/]
* @since [/]
*/
public class GfsFolderEntity {
/** 当前路径 */
private String path;
/** 当前路径 */
private String name;
/** 子目录 */
private List<GfsFolderEntity> children;
/**
* @return the path
*/
public String getPath() {
return path;
}
/**
* @param path the path to set
*/
public void setPath(String path) {
this.path = path;
}
/**
* @return the name
*/
public String getName() {
return name;
}
/**
* @param name the name to set
*/
public void setName(String name) {
this.name = name;
}
/**
* @return the children
*/
public List<GfsFolderEntity> getChildren() {
return children;
}
/**
* @param children the children to set
*/
public void setChildren(List<GfsFolderEntity> children) {
this.children = children;
}
}

@ -0,0 +1,35 @@
/**
* : IGfsService.java
* : </>
* : <>
* @author chen
* : <>
* 201698
* <>
*/
package com.platform.service;
import com.platform.entities.GfsFolderEntity;
/**
* <>
* <>
* @author chen
* @version [201698]
* @see [/]
* @since [/]
*/
public interface IGfsService {
/**
* <> path
* <>
* @param path
* @return
* @see [##]
*/
public GfsFolderEntity getFolder(String path);
}

@ -0,0 +1,36 @@
/**
* : GfsServiceImpl.java
* : </>
* : <>
* @author chen
* : <>
* 201698
* <>
*/
package com.platform.service.impl;
import org.springframework.stereotype.Service;
import com.platform.entities.GfsFolderEntity;
import com.platform.service.IGfsService;
/**
* <>
* <>
* @author chen
* @version [201698]
* @see [/]
* @since [/]
*/
@Service(value = "gfsService")
public class GfsServiceImpl implements IGfsService {
@Override
public GfsFolderEntity getFolder(String path) {
GfsFolderEntity folder = new GfsFolderEntity();
return folder;
}
}
Loading…
Cancel
Save