1 20 21 package com.methodhead.res; 22 23 import com.methodhead.auth.AuthUser; 24 import javax.servlet.http.HttpServletRequest ; 25 import java.io.File ; 26 import org.apache.struts.util.MessageResources; 27 import org.apache.struts.Globals; 28 import com.methodhead.util.OperationContext; 29 30 public class DefaultResPolicy 31 implements 32 ResPolicy { 33 34 36 38 40 42 public boolean isMappingAuthorized( 43 AuthUser user, 44 String path ) { 45 return true; 46 } 47 48 public FileManager newFileManager() { 49 return new FileManager(); 50 } 51 52 55 public void initFileManager( 56 HttpServletRequest request, 57 FileManager fileManager ) { 58 59 String path = 63 request.getSession().getServletContext().getRealPath( "" ); 64 65 if ( path == null ) 66 throw new ResException( "Couldn't get real path for webapp root." ); 67 68 File f = new File ( path ); 69 70 MessageResources messages = 74 ( MessageResources )request.getAttribute( Globals.MESSAGES_KEY ); 75 76 fileManager.addDirectory( messages.getMessage( "res.rootName" ), f ); 77 } 78 79 public FileTree newFileTree() { 80 return new FileTree(); 81 } 82 83 public String isFileMoveAuthorized( 84 OperationContext op ) { 85 return null; 86 } 87 88 public String isFileCopyAuthorized( 89 OperationContext op ) { 90 return null; 91 } 92 93 public String isFileDeleteAuthorized( 94 OperationContext op ) { 95 return null; 96 } 97 98 public String isFileEditAuthorized( 99 OperationContext op ) { 100 return null; 101 } 102 103 public String isFileUnzipAuthorized( 104 OperationContext op ) { 105 return null; 106 } 107 108 public String isFileListAuthorized( 109 OperationContext op ) { 110 return null; 111 } 112 113 public String isFileManageAuthorized( 114 OperationContext op ) { 115 return null; 116 } 117 118 public String isFileUploadFormAuthorized( 119 OperationContext op ) { 120 return null; 121 } 122 123 public String isFileUploadAuthorized( 124 OperationContext op ) { 125 return null; 126 } 127 128 public String isFileCreateFormAuthorized( 129 OperationContext op ) { 130 return null; 131 } 132 133 public String isFileCreateAuthorized( 134 OperationContext op ) { 135 return null; 136 } 137 138 140 } 142
| Popular Tags
|