ããã«ã¡ã¯ã尿管çµç³ãåçºããã¦ãã¾ã£ãid:c-terashimaã§ã
æ°å¹´ã¶ãã«å³ããçã¿ã¯ãã¯ãè¾ãã§ããããçãããå¥åº·ã«æ°ãã¤ãã¦æ¥½ããã¨ã³ã¸ãã¢ã©ã¤ããéã£ã¦ããã¾ããã
æç« ãæ¸ãã«ã¯Wordãå©ç¨ããã¦ããæ¹ãå¤ããå¥ç´æ¸ãä½æããã«ãä»ä½¿ã£ã¦ããWordããã®ã¾ã¾ä½¿ãããã¨ãããè¦æãããã ããã¨ãããã¾ã
Wordãç´æ¥ç·¨éãããå¼ç¤¾ãã¼ã ãºã¯ã©ã¦ãã¸ç»é²ãããä»çµã¿ãå¯è½ãæ¤è¨ããã¨ãããWebDavã使ãã°ã¤ã±ãã®ã§ã¯ãªããï¼ã¨ãããã¨ã§æ©é試ãã¦ã¿ã¾ãã
ç°å¢
次ã®ç°å¢ã§åä½ç¢ºèªãè¡ã£ã¦ãã¾ã
- Java8
- SpringBoot
- SpringSecurity
- Word for Mac
Tomcatã§WebDavãèµ·åããã
ãã¼ã ãºã¯ã©ã¦ãã¯SpringBootã§åä½ãã¦ãããããSpringBoot(Tomcat)ä¸ã§WebDavãåä½ãããå¿
è¦ãããã¾ã
Tomcatã«WebdavServletã¯ã©ã¹ãç¨æããã¦ãã¾ãã®ã§ãã¡ãã使ã£ã¦ããã¾ã
@SpringBootApplication public class Application extends SpringBootServletInitializer { public static main(String[] args) { SpringApplication.run(Application.class, args); } @Bean public TomcatServletWebServerFactory servletContainer() { final TomcatServletWebServerFactory factory = new TomcatServletWebServerFactory(); factory.setDocumentRoot(new File(documentRoot)); return factory; } @Bean public ServletRegistrationBean servletRegistrationBean() { // WebDavã¨ã³ããã¤ã³ãã®è¨å® ServletRegistrationBean bean = new ServletRegistrationBean(new WebdavServlet(), "/webdav/*"); bean.setName("WebDav"); bean.addInitParameter("debug", "1"); bean.addInitParameter("listings", "true"); bean.addInitParameter("readonly", "false"); return bean; } @Bean public StrictHttpFirewall httpFirewall() { StrictHttpFirewall firewall = new StrictHttpFirewall(); firewall.setAllowedHttpMethods(Arrays.asList( "HEAD", "DELETE", "POST", "GET", "OPTIONS", "PATCH", "PUT", "PROPFIND","PROPPATCH", "MKCOL", "COPY", "MOVE", "LOCK", "UNLOCK" )); return firewall; } }
servletContainer
ã¡ã½ããã§ããã¥ã¡ã³ãã«ã¼ãããã¦ãããWordãã¡ã¤ã«ãé
ç½®ããããã¹ã¨ãªãã¾ããå®ééç¨ããå ´åã¯ãã¯ã©ã¦ãã¹ãã¬ã¼ã¸ã«ãã¡ã¤ã«ãæ ¼ç´ãããã¨ã«ãªãã¾ã
servletRegistrationBean
ã¡ã½ããã§Servletã¯ã©ã¹ã®ç»é²ã¨ã¨ã³ããã¤ã³ããè¨å®ãã¦ãã¾ãããã¡ã¤ã«ã¢ã¯ã»ã¹ããéã«ä½¿ããã¾ã
WebdavServletã¯ã©ã¹ã«ãã©ã¡ã¼ã¿ãè¨å®ããå¿
è¦ãããã¾ã
- debugï¼debugãã°ã®åºåãå¶å¾¡
- listingsï¼ãã¡ã¤ã«ãªã¹ãã®åç §ãå¶å¾¡ããããONã«ããªãã¨ãã¡ã¤ã«æä½ãã§ããªã
- readonlyï¼ãã¡ã¤ã«ã®æ¸ãè¾¼ã¿ãå¯è½ã«ãã
WebDavã§ã¯ç¬èªã®HttpMethodãå©ç¨ããããSpringSecurityãå©ç¨ãã¦ããã¨å¼¾ããã¦ãã¾ããããç»é²ãã¾ã
ã¡ã½ãã | æ©è½ |
---|---|
PROPFIND | ããããã£ã®åå¾ |
PROPPATCH | ããããã£ã®å¤æ´ |
MKCOL | ã³ã¬ã¯ã·ã§ã³ã®ä½æ |
COPY | ã³ã¬ã¯ã·ã§ã³ãå«ããªã½ã¼ã¹ããã³ããããã£ã®è¤è£½ |
MOVE | ã³ã¬ã¯ã·ã§ã³ãå«ããªã½ã¼ã¹ã®ç§»å |
LOCK | ã³ã¬ã¯ã·ã§ã³ãå«ããªã½ã¼ã¹ã®ãã㯠|
UNLOCK | ã³ã¬ã¯ã·ã§ã³ãå«ããªã½ã¼ã¹ã®ããã¯è§£é¤ |
OPTIONS | æ¢åã®ã¡ã½ããã¨åã |
GET | æ¢åã®ã¡ã½ããã¨åã |
HEAD | æ¢åã®ã¡ã½ããã¨åã |
POST | æ¢åã®ã¡ã½ããã¨åã |
PUT | ãªã½ã¼ã¹ã®ä½æ |
DELETE | ã³ã¬ã¯ã·ã§ã³ããã³ãã®ã³ã¬ã¯ã·ã§ã³ã«å«ã¾ãããªã½ã¼ã¹ã®åé¤ |
ãµã¼ãå´ã®è¨å®ã¯ããã ãã§ã
ãã©ã¦ã¶ããã¢ã¯ã»ã¹
Office URI ã¹ãã¼ãã§ãã©ã¦ã¶ããWebDavã«ã¢ã¯ã»ã¹ãè¡ãWordãéãã¾ã
Office URI ã¹ãã¼ãã¨ã¯
ãã®ããã¥ã¡ã³ãã§ã¯ããªãã£ã¹çç£æ§åä¸ã¢ããªã±ã¼ã·ã§ã³ç¨ã® Uniform Resource Identifier (URI) ã®å½¢å¼ãå®ç¾©ãã¾ãããã®ã¹ãã¼ã ã¯ãMicrosoft Office 2010 Service Pack 2 以éã§ãµãã¼ãããã¦ãããããã«ã¯ Microsoft Office 2013 for Windows ããã³ Microsoft SharePoint 2013 ãªã©ã®è£½åãå«ã¾ãã¾ããã¾ããOffice for iPhoneãOffice for iPadãããã³ Office for Mac 2011 ã§ããµãã¼ãããã¾ãã
Office URI ã¹ãã¼ã | Microsoft Docsããå¼ç¨
URIã¹ãã¼ãã®ä»æ§ã«åã£ã¦ ms-word:ofe|u|http://localhost:8080/webdav/test.docx
ã«ã¢ã¯ã»ã¹ããã¨Wordãèµ·åããããåããã¤ã¢ãã°ã表示ããã¾ãã®ã§ Microsoft Word.app ãéã
ãã¯ãªãã¯ãã¦ãã ãããWebDavã«å
¬éããã¦ããWordãéãã¾ã
ãã®ã¾ã¾ãç·¨éãä¿åãè¡ãã¨èªåã§ãµã¼ãã«ã¢ãããã¼ãããã¾ã
ã¾ã¨ã
SpringBoot(Tomcat)ã§WebDavã¯çµæ§ããããã«å®è£
ãããã¨ãã§ãã¾ãã
ãã ãæä½éã®åããæ¤è¨¼ããã ããªã®ã§ã»ãã¥ãªãã£ãªã©ã«ã¯åå注æãã¦ãã ãã
ãã¼ã ãºã¯ã©ã¦ãã«Wordã®ç´ç·¨éæ©è½ãçµã¿è¾¼ã¾ããã®ã¯è¿ãï¼ï¼
Holmesã¯ã¨ã³ã¸ãã¢ã»ãã¶ã¤ãã¼ãåéãã¦ãã¾ãï¼
èå³ãããæ¹ã¯ãã¡ããããé£çµ¡ãã ããï¼