└── fks ├── .classpath ├── .gitignore ├── .project ├── .settings ├── .jsdtscope ├── org.eclipse.jdt.core.prefs ├── org.eclipse.wst.common.component ├── org.eclipse.wst.common.project.facet.core.xml ├── org.eclipse.wst.jsdt.ui.superType.container └── org.eclipse.wst.jsdt.ui.superType.name ├── WebContent ├── META-INF │ └── MANIFEST.MF ├── Result.jsp ├── WEB-INF │ ├── lib │ │ ├── commons-fileupload-1.3.2.jar │ │ ├── commons-io-2.2.jar │ │ ├── mail_1.4.jar │ │ ├── mysql-connector-java-5.0.3-bin.jar │ │ ├── mysql-connector-java-5.1.23-bin.jar │ │ ├── mysql-connector-java.jar │ │ ├── org.apache.commons.fileupload.jar │ │ └── org.apache.commons.io.jar │ └── web.xml ├── bootstrapfiles │ ├── bootstrap.min.css │ ├── bootstrap.min.js │ ├── jquery-3.3.1.min.js │ └── popper.min.js ├── css │ ├── s2.css │ └── style.css ├── dataowner_home.jsp ├── docupload.jsp ├── doedit.jsp ├── fonts │ ├── Aulyars Italic.otf │ ├── Aulyars.otf │ ├── Punktype.ttf │ ├── atomic STARGAZE.ttf │ ├── glyphicons-halflings-regular.eot │ ├── glyphicons-halflings-regular.svg │ ├── glyphicons-halflings-regular.ttf │ ├── glyphicons-halflings-regular.woff │ └── glyphicons-halflings-regular.woff2 ├── html │ ├── cloud_menu.html │ ├── dataowner_menu.html │ └── user_menu.html ├── idcheck.jsp ├── images │ ├── PFL020118.jpg │ ├── cldcmp.jpg │ ├── cldlgn.jpg │ ├── cmp.png │ ├── docpat.jpg │ ├── i2.jpg │ ├── i3.jpg │ └── join-background.jpg ├── js │ └── validation.js ├── login.jsp ├── message.jsp ├── reg.jsp ├── search.jsp ├── uedit.jsp ├── user_home.jsp ├── viewsearch.jsp └── viewupfiles.jsp └── src ├── META-INF └── MANIFEST.MF └── fks ├── dbinfo └── database.properties ├── dbtasks └── CrudOperation.java └── servlet ├── AES.java ├── CryptoException.java ├── CryptoUtils.java ├── CryptoUtilsTest.java ├── Document.java ├── EditProfile.java ├── EmailUtility.java ├── FileUploadHandle.java ├── Login.java ├── Logoff.java ├── Reg.java └── edst.java /fks/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /fks/.gitignore: -------------------------------------------------------------------------------- 1 | /build/ 2 | -------------------------------------------------------------------------------- /fks/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | fks 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.wst.common.project.facet.core.builder 15 | 16 | 17 | 18 | 19 | org.eclipse.wst.validation.validationbuilder 20 | 21 | 22 | 23 | 24 | 25 | org.eclipse.jem.workbench.JavaEMFNature 26 | org.eclipse.wst.common.modulecore.ModuleCoreNature 27 | org.eclipse.wst.common.project.facet.core.nature 28 | org.eclipse.jdt.core.javanature 29 | org.eclipse.wst.jsdt.core.jsNature 30 | 31 | 32 | -------------------------------------------------------------------------------- /fks/.settings/.jsdtscope: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /fks/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled 3 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 4 | org.eclipse.jdt.core.compiler.compliance=1.8 5 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 6 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 7 | org.eclipse.jdt.core.compiler.source=1.8 8 | -------------------------------------------------------------------------------- /fks/.settings/org.eclipse.wst.common.component: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /fks/.settings/org.eclipse.wst.common.project.facet.core.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /fks/.settings/org.eclipse.wst.jsdt.ui.superType.container: -------------------------------------------------------------------------------- 1 | org.eclipse.wst.jsdt.launching.baseBrowserLibrary -------------------------------------------------------------------------------- /fks/.settings/org.eclipse.wst.jsdt.ui.superType.name: -------------------------------------------------------------------------------- 1 | Window -------------------------------------------------------------------------------- /fks/WebContent/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Class-Path: 3 | 4 | -------------------------------------------------------------------------------- /fks/WebContent/Result.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=ISO-8859-1" 2 | pageEncoding="ISO-8859-1"%> 3 | 5 | 6 | 7 | 8 | Result 9 | 10 | 11 |
12 |

<%=request.getAttribute("Message")%>

13 |
Click here to get directed to login page
14 |
15 | 16 | -------------------------------------------------------------------------------- /fks/WebContent/WEB-INF/lib/commons-fileupload-1.3.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohitv0909/Fuzzy-Keyword-Search/2a470db84993eaec2edd991a72b16ff7507ef972/fks/WebContent/WEB-INF/lib/commons-fileupload-1.3.2.jar -------------------------------------------------------------------------------- /fks/WebContent/WEB-INF/lib/commons-io-2.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohitv0909/Fuzzy-Keyword-Search/2a470db84993eaec2edd991a72b16ff7507ef972/fks/WebContent/WEB-INF/lib/commons-io-2.2.jar -------------------------------------------------------------------------------- /fks/WebContent/WEB-INF/lib/mail_1.4.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohitv0909/Fuzzy-Keyword-Search/2a470db84993eaec2edd991a72b16ff7507ef972/fks/WebContent/WEB-INF/lib/mail_1.4.jar -------------------------------------------------------------------------------- /fks/WebContent/WEB-INF/lib/mysql-connector-java-5.0.3-bin.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohitv0909/Fuzzy-Keyword-Search/2a470db84993eaec2edd991a72b16ff7507ef972/fks/WebContent/WEB-INF/lib/mysql-connector-java-5.0.3-bin.jar -------------------------------------------------------------------------------- /fks/WebContent/WEB-INF/lib/mysql-connector-java-5.1.23-bin.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohitv0909/Fuzzy-Keyword-Search/2a470db84993eaec2edd991a72b16ff7507ef972/fks/WebContent/WEB-INF/lib/mysql-connector-java-5.1.23-bin.jar -------------------------------------------------------------------------------- /fks/WebContent/WEB-INF/lib/mysql-connector-java.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohitv0909/Fuzzy-Keyword-Search/2a470db84993eaec2edd991a72b16ff7507ef972/fks/WebContent/WEB-INF/lib/mysql-connector-java.jar -------------------------------------------------------------------------------- /fks/WebContent/WEB-INF/lib/org.apache.commons.fileupload.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohitv0909/Fuzzy-Keyword-Search/2a470db84993eaec2edd991a72b16ff7507ef972/fks/WebContent/WEB-INF/lib/org.apache.commons.fileupload.jar -------------------------------------------------------------------------------- /fks/WebContent/WEB-INF/lib/org.apache.commons.io.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohitv0909/Fuzzy-Keyword-Search/2a470db84993eaec2edd991a72b16ff7507ef972/fks/WebContent/WEB-INF/lib/org.apache.commons.io.jar -------------------------------------------------------------------------------- /fks/WebContent/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | fks 4 | 5 | /login.jsp 6 | 7 | 8 | 9 | FileUploadHandle 10 | fks.servlet.FileUploadHandle 11 | 12 | 13 | FileUploadHandle 14 | /FileUploadHandle/* 15 | 16 | 17 | 18 | host 19 | smtp.gmail.com 20 | 21 | 22 | port 23 | 587 24 | 25 | 26 | user 27 | sharedprime3@gmail.com 28 | 29 | 30 | pass 31 | Rohit@123 32 | 33 | -------------------------------------------------------------------------------- /fks/WebContent/bootstrapfiles/bootstrap.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap v4.0.0 (https://getbootstrap.com) 3 | * Copyright 2011-2018 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) 4 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 5 | */ 6 | !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("jquery"),require("popper.js")):"function"==typeof define&&define.amd?define(["exports","jquery","popper.js"],e):e(t.bootstrap={},t.jQuery,t.Popper)}(this,function(t,e,n){"use strict";function i(t,e){for(var n=0;n0?i:null}catch(t){return null}},reflow:function(t){return t.offsetHeight},triggerTransitionEnd:function(n){t(n).trigger(e.end)},supportsTransitionEnd:function(){return Boolean(e)},isElement:function(t){return(t[0]||t).nodeType},typeCheckConfig:function(t,e,n){for(var s in n)if(Object.prototype.hasOwnProperty.call(n,s)){var r=n[s],o=e[s],a=o&&i.isElement(o)?"element":(l=o,{}.toString.call(l).match(/\s([a-zA-Z]+)/)[1].toLowerCase());if(!new RegExp(r).test(a))throw new Error(t.toUpperCase()+': Option "'+s+'" provided type "'+a+'" but expected type "'+r+'".')}var l}};return e=("undefined"==typeof window||!window.QUnit)&&{end:"transitionend"},t.fn.emulateTransitionEnd=n,i.supportsTransitionEnd()&&(t.event.special[i.TRANSITION_END]={bindType:e.end,delegateType:e.end,handle:function(e){if(t(e.target).is(this))return e.handleObj.handler.apply(this,arguments)}}),i}(e),L=(a="alert",h="."+(l="bs.alert"),c=(o=e).fn[a],u={CLOSE:"close"+h,CLOSED:"closed"+h,CLICK_DATA_API:"click"+h+".data-api"},f="alert",d="fade",_="show",g=function(){function t(t){this._element=t}var e=t.prototype;return e.close=function(t){t=t||this._element;var e=this._getRootElement(t);this._triggerCloseEvent(e).isDefaultPrevented()||this._removeElement(e)},e.dispose=function(){o.removeData(this._element,l),this._element=null},e._getRootElement=function(t){var e=P.getSelectorFromElement(t),n=!1;return e&&(n=o(e)[0]),n||(n=o(t).closest("."+f)[0]),n},e._triggerCloseEvent=function(t){var e=o.Event(u.CLOSE);return o(t).trigger(e),e},e._removeElement=function(t){var e=this;o(t).removeClass(_),P.supportsTransitionEnd()&&o(t).hasClass(d)?o(t).one(P.TRANSITION_END,function(n){return e._destroyElement(t,n)}).emulateTransitionEnd(150):this._destroyElement(t)},e._destroyElement=function(t){o(t).detach().trigger(u.CLOSED).remove()},t._jQueryInterface=function(e){return this.each(function(){var n=o(this),i=n.data(l);i||(i=new t(this),n.data(l,i)),"close"===e&&i[e](this)})},t._handleDismiss=function(t){return function(e){e&&e.preventDefault(),t.close(this)}},s(t,null,[{key:"VERSION",get:function(){return"4.0.0"}}]),t}(),o(document).on(u.CLICK_DATA_API,'[data-dismiss="alert"]',g._handleDismiss(new g)),o.fn[a]=g._jQueryInterface,o.fn[a].Constructor=g,o.fn[a].noConflict=function(){return o.fn[a]=c,g._jQueryInterface},g),R=(m="button",E="."+(v="bs.button"),T=".data-api",y=(p=e).fn[m],C="active",I="btn",A="focus",b='[data-toggle^="button"]',D='[data-toggle="buttons"]',S="input",w=".active",N=".btn",O={CLICK_DATA_API:"click"+E+T,FOCUS_BLUR_DATA_API:"focus"+E+T+" blur"+E+T},k=function(){function t(t){this._element=t}var e=t.prototype;return e.toggle=function(){var t=!0,e=!0,n=p(this._element).closest(D)[0];if(n){var i=p(this._element).find(S)[0];if(i){if("radio"===i.type)if(i.checked&&p(this._element).hasClass(C))t=!1;else{var s=p(n).find(w)[0];s&&p(s).removeClass(C)}if(t){if(i.hasAttribute("disabled")||n.hasAttribute("disabled")||i.classList.contains("disabled")||n.classList.contains("disabled"))return;i.checked=!p(this._element).hasClass(C),p(i).trigger("change")}i.focus(),e=!1}}e&&this._element.setAttribute("aria-pressed",!p(this._element).hasClass(C)),t&&p(this._element).toggleClass(C)},e.dispose=function(){p.removeData(this._element,v),this._element=null},t._jQueryInterface=function(e){return this.each(function(){var n=p(this).data(v);n||(n=new t(this),p(this).data(v,n)),"toggle"===e&&n[e]()})},s(t,null,[{key:"VERSION",get:function(){return"4.0.0"}}]),t}(),p(document).on(O.CLICK_DATA_API,b,function(t){t.preventDefault();var e=t.target;p(e).hasClass(I)||(e=p(e).closest(N)),k._jQueryInterface.call(p(e),"toggle")}).on(O.FOCUS_BLUR_DATA_API,b,function(t){var e=p(t.target).closest(N)[0];p(e).toggleClass(A,/^focus(in)?$/.test(t.type))}),p.fn[m]=k._jQueryInterface,p.fn[m].Constructor=k,p.fn[m].noConflict=function(){return p.fn[m]=y,k._jQueryInterface},k),j=function(t){var e="carousel",n="bs.carousel",i="."+n,o=t.fn[e],a={interval:5e3,keyboard:!0,slide:!1,pause:"hover",wrap:!0},l={interval:"(number|boolean)",keyboard:"boolean",slide:"(boolean|string)",pause:"(string|boolean)",wrap:"boolean"},h="next",c="prev",u="left",f="right",d={SLIDE:"slide"+i,SLID:"slid"+i,KEYDOWN:"keydown"+i,MOUSEENTER:"mouseenter"+i,MOUSELEAVE:"mouseleave"+i,TOUCHEND:"touchend"+i,LOAD_DATA_API:"load"+i+".data-api",CLICK_DATA_API:"click"+i+".data-api"},_="carousel",g="active",p="slide",m="carousel-item-right",v="carousel-item-left",E="carousel-item-next",T="carousel-item-prev",y={ACTIVE:".active",ACTIVE_ITEM:".active.carousel-item",ITEM:".carousel-item",NEXT_PREV:".carousel-item-next, .carousel-item-prev",INDICATORS:".carousel-indicators",DATA_SLIDE:"[data-slide], [data-slide-to]",DATA_RIDE:'[data-ride="carousel"]'},C=function(){function o(e,n){this._items=null,this._interval=null,this._activeElement=null,this._isPaused=!1,this._isSliding=!1,this.touchTimeout=null,this._config=this._getConfig(n),this._element=t(e)[0],this._indicatorsElement=t(this._element).find(y.INDICATORS)[0],this._addEventListeners()}var C=o.prototype;return C.next=function(){this._isSliding||this._slide(h)},C.nextWhenVisible=function(){!document.hidden&&t(this._element).is(":visible")&&"hidden"!==t(this._element).css("visibility")&&this.next()},C.prev=function(){this._isSliding||this._slide(c)},C.pause=function(e){e||(this._isPaused=!0),t(this._element).find(y.NEXT_PREV)[0]&&P.supportsTransitionEnd()&&(P.triggerTransitionEnd(this._element),this.cycle(!0)),clearInterval(this._interval),this._interval=null},C.cycle=function(t){t||(this._isPaused=!1),this._interval&&(clearInterval(this._interval),this._interval=null),this._config.interval&&!this._isPaused&&(this._interval=setInterval((document.visibilityState?this.nextWhenVisible:this.next).bind(this),this._config.interval))},C.to=function(e){var n=this;this._activeElement=t(this._element).find(y.ACTIVE_ITEM)[0];var i=this._getItemIndex(this._activeElement);if(!(e>this._items.length-1||e<0))if(this._isSliding)t(this._element).one(d.SLID,function(){return n.to(e)});else{if(i===e)return this.pause(),void this.cycle();var s=e>i?h:c;this._slide(s,this._items[e])}},C.dispose=function(){t(this._element).off(i),t.removeData(this._element,n),this._items=null,this._config=null,this._element=null,this._interval=null,this._isPaused=null,this._isSliding=null,this._activeElement=null,this._indicatorsElement=null},C._getConfig=function(t){return t=r({},a,t),P.typeCheckConfig(e,t,l),t},C._addEventListeners=function(){var e=this;this._config.keyboard&&t(this._element).on(d.KEYDOWN,function(t){return e._keydown(t)}),"hover"===this._config.pause&&(t(this._element).on(d.MOUSEENTER,function(t){return e.pause(t)}).on(d.MOUSELEAVE,function(t){return e.cycle(t)}),"ontouchstart"in document.documentElement&&t(this._element).on(d.TOUCHEND,function(){e.pause(),e.touchTimeout&&clearTimeout(e.touchTimeout),e.touchTimeout=setTimeout(function(t){return e.cycle(t)},500+e._config.interval)}))},C._keydown=function(t){if(!/input|textarea/i.test(t.target.tagName))switch(t.which){case 37:t.preventDefault(),this.prev();break;case 39:t.preventDefault(),this.next()}},C._getItemIndex=function(e){return this._items=t.makeArray(t(e).parent().find(y.ITEM)),this._items.indexOf(e)},C._getItemByDirection=function(t,e){var n=t===h,i=t===c,s=this._getItemIndex(e),r=this._items.length-1;if((i&&0===s||n&&s===r)&&!this._config.wrap)return e;var o=(s+(t===c?-1:1))%this._items.length;return-1===o?this._items[this._items.length-1]:this._items[o]},C._triggerSlideEvent=function(e,n){var i=this._getItemIndex(e),s=this._getItemIndex(t(this._element).find(y.ACTIVE_ITEM)[0]),r=t.Event(d.SLIDE,{relatedTarget:e,direction:n,from:s,to:i});return t(this._element).trigger(r),r},C._setActiveIndicatorElement=function(e){if(this._indicatorsElement){t(this._indicatorsElement).find(y.ACTIVE).removeClass(g);var n=this._indicatorsElement.children[this._getItemIndex(e)];n&&t(n).addClass(g)}},C._slide=function(e,n){var i,s,r,o=this,a=t(this._element).find(y.ACTIVE_ITEM)[0],l=this._getItemIndex(a),c=n||a&&this._getItemByDirection(e,a),_=this._getItemIndex(c),C=Boolean(this._interval);if(e===h?(i=v,s=E,r=u):(i=m,s=T,r=f),c&&t(c).hasClass(g))this._isSliding=!1;else if(!this._triggerSlideEvent(c,r).isDefaultPrevented()&&a&&c){this._isSliding=!0,C&&this.pause(),this._setActiveIndicatorElement(c);var I=t.Event(d.SLID,{relatedTarget:c,direction:r,from:l,to:_});P.supportsTransitionEnd()&&t(this._element).hasClass(p)?(t(c).addClass(s),P.reflow(c),t(a).addClass(i),t(c).addClass(i),t(a).one(P.TRANSITION_END,function(){t(c).removeClass(i+" "+s).addClass(g),t(a).removeClass(g+" "+s+" "+i),o._isSliding=!1,setTimeout(function(){return t(o._element).trigger(I)},0)}).emulateTransitionEnd(600)):(t(a).removeClass(g),t(c).addClass(g),this._isSliding=!1,t(this._element).trigger(I)),C&&this.cycle()}},o._jQueryInterface=function(e){return this.each(function(){var i=t(this).data(n),s=r({},a,t(this).data());"object"==typeof e&&(s=r({},s,e));var l="string"==typeof e?e:s.slide;if(i||(i=new o(this,s),t(this).data(n,i)),"number"==typeof e)i.to(e);else if("string"==typeof l){if("undefined"==typeof i[l])throw new TypeError('No method named "'+l+'"');i[l]()}else s.interval&&(i.pause(),i.cycle())})},o._dataApiClickHandler=function(e){var i=P.getSelectorFromElement(this);if(i){var s=t(i)[0];if(s&&t(s).hasClass(_)){var a=r({},t(s).data(),t(this).data()),l=this.getAttribute("data-slide-to");l&&(a.interval=!1),o._jQueryInterface.call(t(s),a),l&&t(s).data(n).to(l),e.preventDefault()}}},s(o,null,[{key:"VERSION",get:function(){return"4.0.0"}},{key:"Default",get:function(){return a}}]),o}();return t(document).on(d.CLICK_DATA_API,y.DATA_SLIDE,C._dataApiClickHandler),t(window).on(d.LOAD_DATA_API,function(){t(y.DATA_RIDE).each(function(){var e=t(this);C._jQueryInterface.call(e,e.data())})}),t.fn[e]=C._jQueryInterface,t.fn[e].Constructor=C,t.fn[e].noConflict=function(){return t.fn[e]=o,C._jQueryInterface},C}(e),H=function(t){var e="collapse",n="bs.collapse",i="."+n,o=t.fn[e],a={toggle:!0,parent:""},l={toggle:"boolean",parent:"(string|element)"},h={SHOW:"show"+i,SHOWN:"shown"+i,HIDE:"hide"+i,HIDDEN:"hidden"+i,CLICK_DATA_API:"click"+i+".data-api"},c="show",u="collapse",f="collapsing",d="collapsed",_="width",g="height",p={ACTIVES:".show, .collapsing",DATA_TOGGLE:'[data-toggle="collapse"]'},m=function(){function i(e,n){this._isTransitioning=!1,this._element=e,this._config=this._getConfig(n),this._triggerArray=t.makeArray(t('[data-toggle="collapse"][href="#'+e.id+'"],[data-toggle="collapse"][data-target="#'+e.id+'"]'));for(var i=t(p.DATA_TOGGLE),s=0;s0&&(this._selector=o,this._triggerArray.push(r))}this._parent=this._config.parent?this._getParent():null,this._config.parent||this._addAriaAndCollapsedClass(this._element,this._triggerArray),this._config.toggle&&this.toggle()}var o=i.prototype;return o.toggle=function(){t(this._element).hasClass(c)?this.hide():this.show()},o.show=function(){var e,s,r=this;if(!this._isTransitioning&&!t(this._element).hasClass(c)&&(this._parent&&0===(e=t.makeArray(t(this._parent).find(p.ACTIVES).filter('[data-parent="'+this._config.parent+'"]'))).length&&(e=null),!(e&&(s=t(e).not(this._selector).data(n))&&s._isTransitioning))){var o=t.Event(h.SHOW);if(t(this._element).trigger(o),!o.isDefaultPrevented()){e&&(i._jQueryInterface.call(t(e).not(this._selector),"hide"),s||t(e).data(n,null));var a=this._getDimension();t(this._element).removeClass(u).addClass(f),this._element.style[a]=0,this._triggerArray.length>0&&t(this._triggerArray).removeClass(d).attr("aria-expanded",!0),this.setTransitioning(!0);var l=function(){t(r._element).removeClass(f).addClass(u).addClass(c),r._element.style[a]="",r.setTransitioning(!1),t(r._element).trigger(h.SHOWN)};if(P.supportsTransitionEnd()){var _="scroll"+(a[0].toUpperCase()+a.slice(1));t(this._element).one(P.TRANSITION_END,l).emulateTransitionEnd(600),this._element.style[a]=this._element[_]+"px"}else l()}}},o.hide=function(){var e=this;if(!this._isTransitioning&&t(this._element).hasClass(c)){var n=t.Event(h.HIDE);if(t(this._element).trigger(n),!n.isDefaultPrevented()){var i=this._getDimension();if(this._element.style[i]=this._element.getBoundingClientRect()[i]+"px",P.reflow(this._element),t(this._element).addClass(f).removeClass(u).removeClass(c),this._triggerArray.length>0)for(var s=0;s0&&t(n).toggleClass(d,!i).attr("aria-expanded",i)}},i._getTargetFromElement=function(e){var n=P.getSelectorFromElement(e);return n?t(n)[0]:null},i._jQueryInterface=function(e){return this.each(function(){var s=t(this),o=s.data(n),l=r({},a,s.data(),"object"==typeof e&&e);if(!o&&l.toggle&&/show|hide/.test(e)&&(l.toggle=!1),o||(o=new i(this,l),s.data(n,o)),"string"==typeof e){if("undefined"==typeof o[e])throw new TypeError('No method named "'+e+'"');o[e]()}})},s(i,null,[{key:"VERSION",get:function(){return"4.0.0"}},{key:"Default",get:function(){return a}}]),i}();return t(document).on(h.CLICK_DATA_API,p.DATA_TOGGLE,function(e){"A"===e.currentTarget.tagName&&e.preventDefault();var i=t(this),s=P.getSelectorFromElement(this);t(s).each(function(){var e=t(this),s=e.data(n)?"toggle":i.data();m._jQueryInterface.call(e,s)})}),t.fn[e]=m._jQueryInterface,t.fn[e].Constructor=m,t.fn[e].noConflict=function(){return t.fn[e]=o,m._jQueryInterface},m}(e),W=function(t){var e="dropdown",i="bs.dropdown",o="."+i,a=".data-api",l=t.fn[e],h=new RegExp("38|40|27"),c={HIDE:"hide"+o,HIDDEN:"hidden"+o,SHOW:"show"+o,SHOWN:"shown"+o,CLICK:"click"+o,CLICK_DATA_API:"click"+o+a,KEYDOWN_DATA_API:"keydown"+o+a,KEYUP_DATA_API:"keyup"+o+a},u="disabled",f="show",d="dropup",_="dropright",g="dropleft",p="dropdown-menu-right",m="dropdown-menu-left",v="position-static",E='[data-toggle="dropdown"]',T=".dropdown form",y=".dropdown-menu",C=".navbar-nav",I=".dropdown-menu .dropdown-item:not(.disabled)",A="top-start",b="top-end",D="bottom-start",S="bottom-end",w="right-start",N="left-start",O={offset:0,flip:!0,boundary:"scrollParent"},k={offset:"(number|string|function)",flip:"boolean",boundary:"(string|element)"},L=function(){function a(t,e){this._element=t,this._popper=null,this._config=this._getConfig(e),this._menu=this._getMenuElement(),this._inNavbar=this._detectNavbar(),this._addEventListeners()}var l=a.prototype;return l.toggle=function(){if(!this._element.disabled&&!t(this._element).hasClass(u)){var e=a._getParentFromElement(this._element),i=t(this._menu).hasClass(f);if(a._clearMenus(),!i){var s={relatedTarget:this._element},r=t.Event(c.SHOW,s);if(t(e).trigger(r),!r.isDefaultPrevented()){if(!this._inNavbar){if("undefined"==typeof n)throw new TypeError("Bootstrap dropdown require Popper.js (https://popper.js.org)");var o=this._element;t(e).hasClass(d)&&(t(this._menu).hasClass(m)||t(this._menu).hasClass(p))&&(o=e),"scrollParent"!==this._config.boundary&&t(e).addClass(v),this._popper=new n(o,this._menu,this._getPopperConfig())}"ontouchstart"in document.documentElement&&0===t(e).closest(C).length&&t("body").children().on("mouseover",null,t.noop),this._element.focus(),this._element.setAttribute("aria-expanded",!0),t(this._menu).toggleClass(f),t(e).toggleClass(f).trigger(t.Event(c.SHOWN,s))}}}},l.dispose=function(){t.removeData(this._element,i),t(this._element).off(o),this._element=null,this._menu=null,null!==this._popper&&(this._popper.destroy(),this._popper=null)},l.update=function(){this._inNavbar=this._detectNavbar(),null!==this._popper&&this._popper.scheduleUpdate()},l._addEventListeners=function(){var e=this;t(this._element).on(c.CLICK,function(t){t.preventDefault(),t.stopPropagation(),e.toggle()})},l._getConfig=function(n){return n=r({},this.constructor.Default,t(this._element).data(),n),P.typeCheckConfig(e,n,this.constructor.DefaultType),n},l._getMenuElement=function(){if(!this._menu){var e=a._getParentFromElement(this._element);this._menu=t(e).find(y)[0]}return this._menu},l._getPlacement=function(){var e=t(this._element).parent(),n=D;return e.hasClass(d)?(n=A,t(this._menu).hasClass(p)&&(n=b)):e.hasClass(_)?n=w:e.hasClass(g)?n=N:t(this._menu).hasClass(p)&&(n=S),n},l._detectNavbar=function(){return t(this._element).closest(".navbar").length>0},l._getPopperConfig=function(){var t=this,e={};return"function"==typeof this._config.offset?e.fn=function(e){return e.offsets=r({},e.offsets,t._config.offset(e.offsets)||{}),e}:e.offset=this._config.offset,{placement:this._getPlacement(),modifiers:{offset:e,flip:{enabled:this._config.flip},preventOverflow:{boundariesElement:this._config.boundary}}}},a._jQueryInterface=function(e){return this.each(function(){var n=t(this).data(i);if(n||(n=new a(this,"object"==typeof e?e:null),t(this).data(i,n)),"string"==typeof e){if("undefined"==typeof n[e])throw new TypeError('No method named "'+e+'"');n[e]()}})},a._clearMenus=function(e){if(!e||3!==e.which&&("keyup"!==e.type||9===e.which))for(var n=t.makeArray(t(E)),s=0;s0&&r--,40===e.which&&rdocument.documentElement.clientHeight;!this._isBodyOverflowing&&t&&(this._element.style.paddingLeft=this._scrollbarWidth+"px"),this._isBodyOverflowing&&!t&&(this._element.style.paddingRight=this._scrollbarWidth+"px")},p._resetAdjustments=function(){this._element.style.paddingLeft="",this._element.style.paddingRight=""},p._checkScrollbar=function(){var t=document.body.getBoundingClientRect();this._isBodyOverflowing=t.left+t.right
',trigger:"hover focus",title:"",delay:0,html:!1,selector:!1,placement:"top",offset:0,container:!1,fallbackPlacement:"flip",boundary:"scrollParent"},f="show",d="out",_={HIDE:"hide"+o,HIDDEN:"hidden"+o,SHOW:"show"+o,SHOWN:"shown"+o,INSERTED:"inserted"+o,CLICK:"click"+o,FOCUSIN:"focusin"+o,FOCUSOUT:"focusout"+o,MOUSEENTER:"mouseenter"+o,MOUSELEAVE:"mouseleave"+o},g="fade",p="show",m=".tooltip-inner",v=".arrow",E="hover",T="focus",y="click",C="manual",I=function(){function a(t,e){if("undefined"==typeof n)throw new TypeError("Bootstrap tooltips require Popper.js (https://popper.js.org)");this._isEnabled=!0,this._timeout=0,this._hoverState="",this._activeTrigger={},this._popper=null,this.element=t,this.config=this._getConfig(e),this.tip=null,this._setListeners()}var I=a.prototype;return I.enable=function(){this._isEnabled=!0},I.disable=function(){this._isEnabled=!1},I.toggleEnabled=function(){this._isEnabled=!this._isEnabled},I.toggle=function(e){if(this._isEnabled)if(e){var n=this.constructor.DATA_KEY,i=t(e.currentTarget).data(n);i||(i=new this.constructor(e.currentTarget,this._getDelegateConfig()),t(e.currentTarget).data(n,i)),i._activeTrigger.click=!i._activeTrigger.click,i._isWithActiveTrigger()?i._enter(null,i):i._leave(null,i)}else{if(t(this.getTipElement()).hasClass(p))return void this._leave(null,this);this._enter(null,this)}},I.dispose=function(){clearTimeout(this._timeout),t.removeData(this.element,this.constructor.DATA_KEY),t(this.element).off(this.constructor.EVENT_KEY),t(this.element).closest(".modal").off("hide.bs.modal"),this.tip&&t(this.tip).remove(),this._isEnabled=null,this._timeout=null,this._hoverState=null,this._activeTrigger=null,null!==this._popper&&this._popper.destroy(),this._popper=null,this.element=null,this.config=null,this.tip=null},I.show=function(){var e=this;if("none"===t(this.element).css("display"))throw new Error("Please use show on visible elements");var i=t.Event(this.constructor.Event.SHOW);if(this.isWithContent()&&this._isEnabled){t(this.element).trigger(i);var s=t.contains(this.element.ownerDocument.documentElement,this.element);if(i.isDefaultPrevented()||!s)return;var r=this.getTipElement(),o=P.getUID(this.constructor.NAME);r.setAttribute("id",o),this.element.setAttribute("aria-describedby",o),this.setContent(),this.config.animation&&t(r).addClass(g);var l="function"==typeof this.config.placement?this.config.placement.call(this,r,this.element):this.config.placement,h=this._getAttachment(l);this.addAttachmentClass(h);var c=!1===this.config.container?document.body:t(this.config.container);t(r).data(this.constructor.DATA_KEY,this),t.contains(this.element.ownerDocument.documentElement,this.tip)||t(r).appendTo(c),t(this.element).trigger(this.constructor.Event.INSERTED),this._popper=new n(this.element,r,{placement:h,modifiers:{offset:{offset:this.config.offset},flip:{behavior:this.config.fallbackPlacement},arrow:{element:v},preventOverflow:{boundariesElement:this.config.boundary}},onCreate:function(t){t.originalPlacement!==t.placement&&e._handlePopperPlacementChange(t)},onUpdate:function(t){e._handlePopperPlacementChange(t)}}),t(r).addClass(p),"ontouchstart"in document.documentElement&&t("body").children().on("mouseover",null,t.noop);var u=function(){e.config.animation&&e._fixTransition();var n=e._hoverState;e._hoverState=null,t(e.element).trigger(e.constructor.Event.SHOWN),n===d&&e._leave(null,e)};P.supportsTransitionEnd()&&t(this.tip).hasClass(g)?t(this.tip).one(P.TRANSITION_END,u).emulateTransitionEnd(a._TRANSITION_DURATION):u()}},I.hide=function(e){var n=this,i=this.getTipElement(),s=t.Event(this.constructor.Event.HIDE),r=function(){n._hoverState!==f&&i.parentNode&&i.parentNode.removeChild(i),n._cleanTipClass(),n.element.removeAttribute("aria-describedby"),t(n.element).trigger(n.constructor.Event.HIDDEN),null!==n._popper&&n._popper.destroy(),e&&e()};t(this.element).trigger(s),s.isDefaultPrevented()||(t(i).removeClass(p),"ontouchstart"in document.documentElement&&t("body").children().off("mouseover",null,t.noop),this._activeTrigger[y]=!1,this._activeTrigger[T]=!1,this._activeTrigger[E]=!1,P.supportsTransitionEnd()&&t(this.tip).hasClass(g)?t(i).one(P.TRANSITION_END,r).emulateTransitionEnd(150):r(),this._hoverState="")},I.update=function(){null!==this._popper&&this._popper.scheduleUpdate()},I.isWithContent=function(){return Boolean(this.getTitle())},I.addAttachmentClass=function(e){t(this.getTipElement()).addClass("bs-tooltip-"+e)},I.getTipElement=function(){return this.tip=this.tip||t(this.config.template)[0],this.tip},I.setContent=function(){var e=t(this.getTipElement());this.setElementContent(e.find(m),this.getTitle()),e.removeClass(g+" "+p)},I.setElementContent=function(e,n){var i=this.config.html;"object"==typeof n&&(n.nodeType||n.jquery)?i?t(n).parent().is(e)||e.empty().append(n):e.text(t(n).text()):e[i?"html":"text"](n)},I.getTitle=function(){var t=this.element.getAttribute("data-original-title");return t||(t="function"==typeof this.config.title?this.config.title.call(this.element):this.config.title),t},I._getAttachment=function(t){return c[t.toUpperCase()]},I._setListeners=function(){var e=this;this.config.trigger.split(" ").forEach(function(n){if("click"===n)t(e.element).on(e.constructor.Event.CLICK,e.config.selector,function(t){return e.toggle(t)});else if(n!==C){var i=n===E?e.constructor.Event.MOUSEENTER:e.constructor.Event.FOCUSIN,s=n===E?e.constructor.Event.MOUSELEAVE:e.constructor.Event.FOCUSOUT;t(e.element).on(i,e.config.selector,function(t){return e._enter(t)}).on(s,e.config.selector,function(t){return e._leave(t)})}t(e.element).closest(".modal").on("hide.bs.modal",function(){return e.hide()})}),this.config.selector?this.config=r({},this.config,{trigger:"manual",selector:""}):this._fixTitle()},I._fixTitle=function(){var t=typeof this.element.getAttribute("data-original-title");(this.element.getAttribute("title")||"string"!==t)&&(this.element.setAttribute("data-original-title",this.element.getAttribute("title")||""),this.element.setAttribute("title",""))},I._enter=function(e,n){var i=this.constructor.DATA_KEY;(n=n||t(e.currentTarget).data(i))||(n=new this.constructor(e.currentTarget,this._getDelegateConfig()),t(e.currentTarget).data(i,n)),e&&(n._activeTrigger["focusin"===e.type?T:E]=!0),t(n.getTipElement()).hasClass(p)||n._hoverState===f?n._hoverState=f:(clearTimeout(n._timeout),n._hoverState=f,n.config.delay&&n.config.delay.show?n._timeout=setTimeout(function(){n._hoverState===f&&n.show()},n.config.delay.show):n.show())},I._leave=function(e,n){var i=this.constructor.DATA_KEY;(n=n||t(e.currentTarget).data(i))||(n=new this.constructor(e.currentTarget,this._getDelegateConfig()),t(e.currentTarget).data(i,n)),e&&(n._activeTrigger["focusout"===e.type?T:E]=!1),n._isWithActiveTrigger()||(clearTimeout(n._timeout),n._hoverState=d,n.config.delay&&n.config.delay.hide?n._timeout=setTimeout(function(){n._hoverState===d&&n.hide()},n.config.delay.hide):n.hide())},I._isWithActiveTrigger=function(){for(var t in this._activeTrigger)if(this._activeTrigger[t])return!0;return!1},I._getConfig=function(n){return"number"==typeof(n=r({},this.constructor.Default,t(this.element).data(),n)).delay&&(n.delay={show:n.delay,hide:n.delay}),"number"==typeof n.title&&(n.title=n.title.toString()),"number"==typeof n.content&&(n.content=n.content.toString()),P.typeCheckConfig(e,n,this.constructor.DefaultType),n},I._getDelegateConfig=function(){var t={};if(this.config)for(var e in this.config)this.constructor.Default[e]!==this.config[e]&&(t[e]=this.config[e]);return t},I._cleanTipClass=function(){var e=t(this.getTipElement()),n=e.attr("class").match(l);null!==n&&n.length>0&&e.removeClass(n.join(""))},I._handlePopperPlacementChange=function(t){this._cleanTipClass(),this.addAttachmentClass(this._getAttachment(t.placement))},I._fixTransition=function(){var e=this.getTipElement(),n=this.config.animation;null===e.getAttribute("x-placement")&&(t(e).removeClass(g),this.config.animation=!1,this.hide(),this.show(),this.config.animation=n)},a._jQueryInterface=function(e){return this.each(function(){var n=t(this).data(i),s="object"==typeof e&&e;if((n||!/dispose|hide/.test(e))&&(n||(n=new a(this,s),t(this).data(i,n)),"string"==typeof e)){if("undefined"==typeof n[e])throw new TypeError('No method named "'+e+'"');n[e]()}})},s(a,null,[{key:"VERSION",get:function(){return"4.0.0"}},{key:"Default",get:function(){return u}},{key:"NAME",get:function(){return e}},{key:"DATA_KEY",get:function(){return i}},{key:"Event",get:function(){return _}},{key:"EVENT_KEY",get:function(){return o}},{key:"DefaultType",get:function(){return h}}]),a}();return t.fn[e]=I._jQueryInterface,t.fn[e].Constructor=I,t.fn[e].noConflict=function(){return t.fn[e]=a,I._jQueryInterface},I}(e),x=function(t){var e="popover",n="bs.popover",i="."+n,o=t.fn[e],a=new RegExp("(^|\\s)bs-popover\\S+","g"),l=r({},U.Default,{placement:"right",trigger:"click",content:"",template:''}),h=r({},U.DefaultType,{content:"(string|element|function)"}),c="fade",u="show",f=".popover-header",d=".popover-body",_={HIDE:"hide"+i,HIDDEN:"hidden"+i,SHOW:"show"+i,SHOWN:"shown"+i,INSERTED:"inserted"+i,CLICK:"click"+i,FOCUSIN:"focusin"+i,FOCUSOUT:"focusout"+i,MOUSEENTER:"mouseenter"+i,MOUSELEAVE:"mouseleave"+i},g=function(r){var o,g;function p(){return r.apply(this,arguments)||this}g=r,(o=p).prototype=Object.create(g.prototype),o.prototype.constructor=o,o.__proto__=g;var m=p.prototype;return m.isWithContent=function(){return this.getTitle()||this._getContent()},m.addAttachmentClass=function(e){t(this.getTipElement()).addClass("bs-popover-"+e)},m.getTipElement=function(){return this.tip=this.tip||t(this.config.template)[0],this.tip},m.setContent=function(){var e=t(this.getTipElement());this.setElementContent(e.find(f),this.getTitle());var n=this._getContent();"function"==typeof n&&(n=n.call(this.element)),this.setElementContent(e.find(d),n),e.removeClass(c+" "+u)},m._getContent=function(){return this.element.getAttribute("data-content")||this.config.content},m._cleanTipClass=function(){var e=t(this.getTipElement()),n=e.attr("class").match(a);null!==n&&n.length>0&&e.removeClass(n.join(""))},p._jQueryInterface=function(e){return this.each(function(){var i=t(this).data(n),s="object"==typeof e?e:null;if((i||!/destroy|hide/.test(e))&&(i||(i=new p(this,s),t(this).data(n,i)),"string"==typeof e)){if("undefined"==typeof i[e])throw new TypeError('No method named "'+e+'"');i[e]()}})},s(p,null,[{key:"VERSION",get:function(){return"4.0.0"}},{key:"Default",get:function(){return l}},{key:"NAME",get:function(){return e}},{key:"DATA_KEY",get:function(){return n}},{key:"Event",get:function(){return _}},{key:"EVENT_KEY",get:function(){return i}},{key:"DefaultType",get:function(){return h}}]),p}(U);return t.fn[e]=g._jQueryInterface,t.fn[e].Constructor=g,t.fn[e].noConflict=function(){return t.fn[e]=o,g._jQueryInterface},g}(e),K=function(t){var e="scrollspy",n="bs.scrollspy",i="."+n,o=t.fn[e],a={offset:10,method:"auto",target:""},l={offset:"number",method:"string",target:"(string|element)"},h={ACTIVATE:"activate"+i,SCROLL:"scroll"+i,LOAD_DATA_API:"load"+i+".data-api"},c="dropdown-item",u="active",f={DATA_SPY:'[data-spy="scroll"]',ACTIVE:".active",NAV_LIST_GROUP:".nav, .list-group",NAV_LINKS:".nav-link",NAV_ITEMS:".nav-item",LIST_ITEMS:".list-group-item",DROPDOWN:".dropdown",DROPDOWN_ITEMS:".dropdown-item",DROPDOWN_TOGGLE:".dropdown-toggle"},d="offset",_="position",g=function(){function o(e,n){var i=this;this._element=e,this._scrollElement="BODY"===e.tagName?window:e,this._config=this._getConfig(n),this._selector=this._config.target+" "+f.NAV_LINKS+","+this._config.target+" "+f.LIST_ITEMS+","+this._config.target+" "+f.DROPDOWN_ITEMS,this._offsets=[],this._targets=[],this._activeTarget=null,this._scrollHeight=0,t(this._scrollElement).on(h.SCROLL,function(t){return i._process(t)}),this.refresh(),this._process()}var g=o.prototype;return g.refresh=function(){var e=this,n=this._scrollElement===this._scrollElement.window?d:_,i="auto"===this._config.method?n:this._config.method,s=i===_?this._getScrollTop():0;this._offsets=[],this._targets=[],this._scrollHeight=this._getScrollHeight(),t.makeArray(t(this._selector)).map(function(e){var n,r=P.getSelectorFromElement(e);if(r&&(n=t(r)[0]),n){var o=n.getBoundingClientRect();if(o.width||o.height)return[t(n)[i]().top+s,r]}return null}).filter(function(t){return t}).sort(function(t,e){return t[0]-e[0]}).forEach(function(t){e._offsets.push(t[0]),e._targets.push(t[1])})},g.dispose=function(){t.removeData(this._element,n),t(this._scrollElement).off(i),this._element=null,this._scrollElement=null,this._config=null,this._selector=null,this._offsets=null,this._targets=null,this._activeTarget=null,this._scrollHeight=null},g._getConfig=function(n){if("string"!=typeof(n=r({},a,n)).target){var i=t(n.target).attr("id");i||(i=P.getUID(e),t(n.target).attr("id",i)),n.target="#"+i}return P.typeCheckConfig(e,n,l),n},g._getScrollTop=function(){return this._scrollElement===window?this._scrollElement.pageYOffset:this._scrollElement.scrollTop},g._getScrollHeight=function(){return this._scrollElement.scrollHeight||Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)},g._getOffsetHeight=function(){return this._scrollElement===window?window.innerHeight:this._scrollElement.getBoundingClientRect().height},g._process=function(){var t=this._getScrollTop()+this._config.offset,e=this._getScrollHeight(),n=this._config.offset+e-this._getOffsetHeight();if(this._scrollHeight!==e&&this.refresh(),t>=n){var i=this._targets[this._targets.length-1];this._activeTarget!==i&&this._activate(i)}else{if(this._activeTarget&&t0)return this._activeTarget=null,void this._clear();for(var s=this._offsets.length;s--;){this._activeTarget!==this._targets[s]&&t>=this._offsets[s]&&("undefined"==typeof this._offsets[s+1]||t=4)throw new Error("Bootstrap's JavaScript requires at least jQuery v1.9.1 but less than v4.0.0")}(e),t.Util=P,t.Alert=L,t.Button=R,t.Carousel=j,t.Collapse=H,t.Dropdown=W,t.Modal=M,t.Popover=x,t.Scrollspy=K,t.Tab=V,t.Tooltip=U,Object.defineProperty(t,"__esModule",{value:!0})}); 7 | //# sourceMappingURL=bootstrap.min.js.map -------------------------------------------------------------------------------- /fks/WebContent/bootstrapfiles/popper.min.js: -------------------------------------------------------------------------------- 1 | (function (global, factory) { 2 | typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : 3 | typeof define === 'function' && define.amd ? define(factory) : 4 | (global.Popper = factory()); 5 | }(this, (function () { 'use strict'; 6 | 7 | Object.assign||Object.defineProperty(Object,'assign',{enumerable:!1,configurable:!0,writable:!0,value:function value(a){if(a===void 0||null===a)throw new TypeError('Cannot convert first argument to object');var b=Object(a);for(var c=1;cd.order?1:0} 64 | 65 | function applyStyle(a){var b={position:a.offsets.popper.position},c=Math.round(a.offsets.popper.left),d=Math.round(a.offsets.popper.top),e=getSupportedPropertyName('transform');return a.instance.options.gpuAcceleration&&e?(b[e]='translate3d('+c+'px, '+d+'px, 0)',b.top=0,b.left=0):(b.left=c,b.top=d),Object.assign(b,a.styles),setStyle(a.instance.popper,b),a.instance.popper.setAttribute('x-placement',a.placement),a.offsets.arrow&&setStyle(a.arrowElement,a.offsets.arrow),a}function applyStyleOnLoad(a,b,c){return b.setAttribute('x-placement',c.placement),c} 66 | 67 | function arrow(a,b){var c=b.element;if('string'==typeof c&&(c=a.instance.popper.querySelector(c)),!c)return a;if(!a.instance.popper.contains(c))return console.warn('WARNING: `arrowElement` must be child of its popper element!'),a;if(!isModifierRequired(a.instance.modifiers,'arrow','keepTogether'))return console.warn('WARNING: keepTogether modifier is required by arrow modifier in order to work, be sure to include it before arrow!'),a;var d={},e=a.placement.split('-')[0],f=getPopperClientRect(a.offsets.popper),g=a.offsets.reference,h=-1!==['left','right'].indexOf(e),i=h?'height':'width',j=h?'top':'left',k=h?'left':'top',l=h?'bottom':'right',m=getOuterSizes(c)[i];g[l]-mf[l]&&(a.offsets.popper[j]+=g[j]+m-f[l]);var n=g[j]+g[i]/2-m/2,o=n-getPopperClientRect(a.offsets.popper)[j];return o=Math.max(Math.min(f[i]-m,o),0),d[j]=o,d[k]='',a.offsets.arrow=d,a.arrowElement=c,a} 68 | 69 | function getOppositePlacement(a){var b={left:'right',right:'left',bottom:'top',top:'bottom'};return a.replace(/left|right|bottom|top/g,function(c){return b[c]})} 70 | 71 | function getOppositeVariation(a){if('end'===a)return'start';return'start'===a?'end':a} 72 | 73 | function flip(a,b){if(a.flipped&&a.placement===a.originalPlacement)return a;var c=getBoundaries(a.instance.popper,b.padding,b.boundariesElement),d=a.placement.split('-')[0],e=getOppositePlacement(d),f=a.placement.split('-')[1]||'',g=[];return g='flip'===b.behavior?[d,e]:b.behavior,g.forEach(function(h,i){if(d!==h||g.length===i+1)return a;d=a.placement.split('-')[0],e=getOppositePlacement(d);var j=getPopperClientRect(a.offsets.popper),k='left'===d&&Math.floor(j.left)Math.floor(c.right)||'top'===d&&Math.floor(j.top)Math.floor(c.bottom),l=-1!==['top','bottom'].indexOf(d),m=!!b.flipVariations&&(l&&'start'===f&&Math.floor(j.left)Math.floor(c.right)||!l&&'start'===f&&Math.floor(j.top)Math.floor(c.bottom));(k||m)&&(a.flipped=!0,k&&(d=g[i+1]),m&&(f=getOppositeVariation(f)),a.placement=d+(f?'-'+f:''),a.offsets.popper=getOffsets(a.instance.state,a.instance.popper,a.instance.reference,a.placement).popper,a=runModifiers(a.instance.modifiers,a,'flip'));}),a} 74 | 75 | function keepTogether(a){var b=getPopperClientRect(a.offsets.popper),c=a.offsets.reference,d=Math.floor,e=a.placement.split('-')[0];return-1===['top','bottom'].indexOf(e)?(b.bottomd(c.bottom)&&(a.offsets.popper.top=d(c.bottom))):(b.rightd(c.right)&&(a.offsets.popper.left=d(c.right))),a} 76 | 77 | function offset(a,b){var c=a.placement,d=a.offsets.popper,e=void 0;return isNumeric(b.offset)?e=[b.offset,0]:(e=b.offset.split(' '),e=e.map(function(f,g){var h=f.match(/(\d*\.?\d*)(.*)/),i=+h[1],j=h[2],k=-1!==c.indexOf('right')||-1!==c.indexOf('left');if(1===g&&(k=!k),'%'===j||'%r'===j){var l=getPopperClientRect(a.offsets.reference),m=void 0;return m=k?l.height:l.width,m/100*i}if('%p'===j){var _l=getPopperClientRect(a.offsets.popper),_m=void 0;return _m=k?_l.height:_l.width,_m/100*i}if('vh'===j||'vw'===j){var _l2=void 0;return _l2='vh'===j?Math.max(document.documentElement.clientHeight,window.innerHeight||0):Math.max(document.documentElement.clientWidth,window.innerWidth||0),_l2/100*i}return'px'===j?+i:+f})),-1===a.placement.indexOf('left')?-1===a.placement.indexOf('right')?-1===a.placement.indexOf('top')?-1!==a.placement.indexOf('bottom')&&(d.left+=e[0],d.top+=e[1]||0):(d.left+=e[0],d.top-=e[1]||0):(d.top+=e[0],d.left+=e[1]||0):(d.top+=e[0],d.left-=e[1]||0),a} 78 | 79 | function preventOverflow(c,d){var e=d.boundariesElement||getOffsetParent(c.instance.popper),f=getBoundaries(c.instance.popper,d.padding,e);d.boundaries=f;var g=d.priority,h=getPopperClientRect(c.offsets.popper),i={left:function left(){var j=h.left;return h.leftf.right&&!shouldOverflowBoundary(c,d,'right')&&(j=Math.min(h.left,f.right-h.width)),{left:j}},top:function top(){var j=h.top;return h.topf.bottom&&!shouldOverflowBoundary(c,d,'bottom')&&(j=Math.min(h.top,f.bottom-h.height)),{top:j}}};return g.forEach(function(j){c.offsets.popper=Object.assign(h,i[j]());}),c}function shouldOverflowBoundary(c,d,e){return!!d.escapeWithReference&&(c.flipped&&isSameAxis(c.originalPlacement,e)||!!isSameAxis(c.originalPlacement,e)||!0)}function isSameAxis(c,d){var e=c.split('-')[0],f=d.split('-')[0];return e===f||e===getOppositePlacement(d)} 80 | 81 | function shift(a){var b=a.placement,c=b.split('-')[0],d=b.split('-')[1];if(d){var e=a.offsets.reference,f=getPopperClientRect(a.offsets.popper),g={y:{start:{top:e.top},end:{top:e.top+e.height-f.height}},x:{start:{left:e.left},end:{left:e.left+e.width-f.width}}},h=-1===['bottom','top'].indexOf(c)?'y':'x';a.offsets.popper=Object.assign(f,g[h][d]);}return a} 82 | 83 | function hide(a){if(!isModifierRequired(a.instance.modifiers,'hide','preventOverflow'))return console.warn('WARNING: preventOverflow modifier is required by hide modifier in order to work, be sure to include it before hide!'),a;var b=a.offsets.reference,c=a.instance.modifiers.filter(function(d){return'preventOverflow'===d.name})[0].boundaries;if(b.bottomc.right||b.top>c.bottom||b.right 3 | 4 | 5 | 6 | 7 | Data Owner Home 8 | 10 | 11 | 12 | 13 | 14 | 15 |
17 |

Data Owner Home Page

18 |
19 |
20 | <%@include file="/html/dataowner_menu.html"%> 21 |
22 |
23 | 24 | -------------------------------------------------------------------------------- /fks/WebContent/docupload.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=ISO-8859-1" 2 | pageEncoding="ISO-8859-1"%> 3 | 4 | 5 | 6 | 7 | Upload The Documents 8 | 10 | 11 | 12 | 13 | 35 | 36 | 37 | <% 38 | HttpSession hs = request.getSession(false); 39 | String uid = (String) hs.getAttribute("userid"); 40 | %> 41 |
43 |

Upload Documents

44 |
45 |
46 | <%@include file="/html/dataowner_menu.html"%> 47 |
48 |
49 |
50 | 51 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 80 | 81 |
Select the document
Data Owner Id readonly="readonly">
File Name
79 |
82 |
83 | <% 84 | String file_name=(String)request.getParameter("filename"); 85 | if(file_name!=null){ 86 | out.println(file_name+" File uploaded successfuly"); 87 | } 88 | %> 89 |
90 | 91 | -------------------------------------------------------------------------------- /fks/WebContent/doedit.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=ISO-8859-1" 2 | pageEncoding="ISO-8859-1"%> 3 | <%@page import="java.sql.*,fks.dbtasks.*,fks.servlet.*" %> 4 | 5 | 6 | 7 | 8 | Edit Profile 9 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
19 |

Edit Profile

20 |
21 |
22 | <%@include file="/html/dataowner_menu.html"%> 23 |
24 |
25 |
26 | 27 | <% 28 | HttpSession hs=request.getSession(false); 29 | String uid=(String)hs.getAttribute("userid"); 30 | String strsql="select * from logininfo where userid=?"; 31 | ResultSet rs=CrudOperation.fetchData(strsql,uid); 32 | if(rs.next()) 33 | { 34 | final String key="ssshhhhhhhhhhh!!!!"; 35 | hs.setAttribute("userpass", AES.decrypt(rs.getString(2), key)); 36 | hs.setAttribute("role",rs.getString(5)); 37 | %> 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 50 | 51 | 52 | 53 | 54 | <% 55 | } 56 | rs.close(); 57 | %> 58 |
User Name
Email ID
Enter current password to authenticate:
59 | <% String message = (String)request.getAttribute("msg");%> 60 | 64 |
65 |
66 | 67 | -------------------------------------------------------------------------------- /fks/WebContent/fonts/Aulyars Italic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohitv0909/Fuzzy-Keyword-Search/2a470db84993eaec2edd991a72b16ff7507ef972/fks/WebContent/fonts/Aulyars Italic.otf -------------------------------------------------------------------------------- /fks/WebContent/fonts/Aulyars.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohitv0909/Fuzzy-Keyword-Search/2a470db84993eaec2edd991a72b16ff7507ef972/fks/WebContent/fonts/Aulyars.otf -------------------------------------------------------------------------------- /fks/WebContent/fonts/Punktype.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohitv0909/Fuzzy-Keyword-Search/2a470db84993eaec2edd991a72b16ff7507ef972/fks/WebContent/fonts/Punktype.ttf -------------------------------------------------------------------------------- /fks/WebContent/fonts/atomic STARGAZE.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohitv0909/Fuzzy-Keyword-Search/2a470db84993eaec2edd991a72b16ff7507ef972/fks/WebContent/fonts/atomic STARGAZE.ttf -------------------------------------------------------------------------------- /fks/WebContent/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohitv0909/Fuzzy-Keyword-Search/2a470db84993eaec2edd991a72b16ff7507ef972/fks/WebContent/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /fks/WebContent/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohitv0909/Fuzzy-Keyword-Search/2a470db84993eaec2edd991a72b16ff7507ef972/fks/WebContent/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /fks/WebContent/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohitv0909/Fuzzy-Keyword-Search/2a470db84993eaec2edd991a72b16ff7507ef972/fks/WebContent/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /fks/WebContent/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohitv0909/Fuzzy-Keyword-Search/2a470db84993eaec2edd991a72b16ff7507ef972/fks/WebContent/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /fks/WebContent/html/cloud_menu.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Cloud Menu 6 | 7 | 9 | 10 | 11 | 12 | 13 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /fks/WebContent/html/dataowner_menu.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Data Owner Menu 6 | 11 | 12 | 13 |
15 | 22 |
23 | 24 | -------------------------------------------------------------------------------- /fks/WebContent/html/user_menu.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | User Menu 6 | 7 | 9 | 10 | 11 | 12 | 13 | 19 | 20 | -------------------------------------------------------------------------------- /fks/WebContent/idcheck.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=ISO-8859-1" 2 | pageEncoding="ISO-8859-1"%> 3 | <%@page import="java.sql.*,fks.dbtasks.*,java.io.*" %> 4 | 5 | 6 | 7 | 8 | Check ID 9 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | <% 18 | response.setContentType("text/html"); 19 | PrintWriter o=response.getWriter(); 20 | String id=request.getParameter("recid"); 21 | System.out.println(id); 22 | String str1="select * from logininfo where userid=?"; 23 | ResultSet rs=CrudOperation.fetchData(str1, id); 24 | if(rs.next()) 25 | { 26 | out.println("

ID already taken

"); 27 | } 28 | else 29 | { 30 | out.println("

ID available

"); 31 | } 32 | rs.close();%> 33 | 34 | -------------------------------------------------------------------------------- /fks/WebContent/images/PFL020118.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohitv0909/Fuzzy-Keyword-Search/2a470db84993eaec2edd991a72b16ff7507ef972/fks/WebContent/images/PFL020118.jpg -------------------------------------------------------------------------------- /fks/WebContent/images/cldcmp.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohitv0909/Fuzzy-Keyword-Search/2a470db84993eaec2edd991a72b16ff7507ef972/fks/WebContent/images/cldcmp.jpg -------------------------------------------------------------------------------- /fks/WebContent/images/cldlgn.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohitv0909/Fuzzy-Keyword-Search/2a470db84993eaec2edd991a72b16ff7507ef972/fks/WebContent/images/cldlgn.jpg -------------------------------------------------------------------------------- /fks/WebContent/images/cmp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohitv0909/Fuzzy-Keyword-Search/2a470db84993eaec2edd991a72b16ff7507ef972/fks/WebContent/images/cmp.png -------------------------------------------------------------------------------- /fks/WebContent/images/docpat.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohitv0909/Fuzzy-Keyword-Search/2a470db84993eaec2edd991a72b16ff7507ef972/fks/WebContent/images/docpat.jpg -------------------------------------------------------------------------------- /fks/WebContent/images/i2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohitv0909/Fuzzy-Keyword-Search/2a470db84993eaec2edd991a72b16ff7507ef972/fks/WebContent/images/i2.jpg -------------------------------------------------------------------------------- /fks/WebContent/images/i3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohitv0909/Fuzzy-Keyword-Search/2a470db84993eaec2edd991a72b16ff7507ef972/fks/WebContent/images/i3.jpg -------------------------------------------------------------------------------- /fks/WebContent/images/join-background.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohitv0909/Fuzzy-Keyword-Search/2a470db84993eaec2edd991a72b16ff7507ef972/fks/WebContent/images/join-background.jpg -------------------------------------------------------------------------------- /fks/WebContent/js/validation.js: -------------------------------------------------------------------------------- 1 | function checkEmpty(data) 2 | { 3 | if (data.length == 0) 4 | return false 5 | else 6 | return true 7 | } 8 | 9 | function checkLength(data) 10 | { 11 | if (data.length<8 ) 12 | return false 13 | else 14 | return true 15 | } 16 | 17 | function checkPhone(data) 18 | { 19 | if (data.length==10) 20 | return true 21 | else 22 | return false 23 | } 24 | -------------------------------------------------------------------------------- /fks/WebContent/login.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=ISO-8859-1" 2 | pageEncoding="ISO-8859-1"%> 3 | 4 | 5 | 6 | 7 | Login 8 | 10 | 11 | 12 | 13 | 43 | 44 | 45 | <% 46 | String ms = (String) request.getAttribute("msg"); 47 | %> 48 |
Cloud Portal
49 |
50 | 51 | 59 |
60 |
62 |
64 | 65 | 66 | 67 | 69 | 70 | 71 | 72 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 |
User ID
Password
New here, sign up with us!!
82 | <% 83 | if (ms != null) { 84 | %> 85 |

<%=ms%>

86 | <% 87 | } 88 | %> 89 | 90 |
91 |
92 |
93 |
94 | 95 | -------------------------------------------------------------------------------- /fks/WebContent/message.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | 5 | 6 | 7 | 8 | Upload Result 9 | 10 | 11 |
12 |

${message}

13 |
14 | 15 | -------------------------------------------------------------------------------- /fks/WebContent/reg.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=ISO-8859-1" 2 | pageEncoding="ISO-8859-1"%> 3 | 4 | 5 | 6 | 7 | Registration 8 | 10 | 11 | 12 | 13 | 86 | 94 | 95 | 96 |

REGISTRATION

97 |
98 |
99 | 100 | 102 | 103 | 104 | 105 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 |
Role 106 | Data OwnerUser
User ID
User Password
User Name
Email ID
Go to Login Page.
170 |
171 |
172 | 173 | -------------------------------------------------------------------------------- /fks/WebContent/search.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=ISO-8859-1" 2 | pageEncoding="ISO-8859-1"%> 3 | <%@page import="java.sql.*,fks.dbtasks.CrudOperation,java.io.*,fks.servlet.*" %> 4 | 5 | 6 | 7 | 8 | User Home 9 | 11 | 12 | 13 | 14 | 15 | 16 |
18 |

Search Files

19 |
20 |
21 | <%@include file="/html/user_menu.html"%> 22 |
23 |
24 | <%-- <% 25 | HttpSession hs=request.getSession(false); 26 | String uid=(String)hs.getAttribute("userid"); 27 | String strsql="select * from auth where userid=?"; 28 | ResultSet rs=CrudOperation.fetchData(strsql,uid); 29 | if(rs.getString("request").equalsIgnoreCase("no")) 30 | { 31 | %> 32 |
33 | 34 | 36 |
35 |
37 |
38 | <% 39 | } 40 | else 41 | { 42 | %> --%> 43 |
44 | 45 | 47 | 49 | 51 |
46 |
Search Text: 48 |
50 |
52 |
53 | <%-- <% 54 | } 55 | rs.close(); 56 | %> --%> 57 |
58 | 59 | -------------------------------------------------------------------------------- /fks/WebContent/uedit.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=ISO-8859-1" 2 | pageEncoding="ISO-8859-1"%> 3 | <%@page import="java.sql.*,fks.dbtasks.*,fks.servlet.*" %> 4 | 5 | 6 | 7 | 8 | Edit Profile 9 | 11 | 12 | 13 | 14 | 15 | 16 |
18 |

Edit Profile

19 |
20 |
21 | <%@include file="/html/user_menu.html"%> 22 |
23 |
24 |
25 | 26 | <% 27 | HttpSession hs=request.getSession(false); 28 | String uid=(String)hs.getAttribute("userid"); 29 | String strsql="select * from logininfo where userid=?"; 30 | ResultSet rs=CrudOperation.fetchData(strsql,uid); 31 | if(rs.next()) 32 | { 33 | final String key="ssshhhhhhhhhhh!!!!"; 34 | hs.setAttribute("userpass", AES.decrypt(rs.getString(2), key)); 35 | hs.setAttribute("role",rs.getString(5)); 36 | %> 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 49 | 50 | 51 | 52 | 53 | <% 54 | } 55 | rs.close(); 56 | %> 57 |
User Name
Email ID
Enter current password to authenticate:
58 |
59 | <% String message = (String)request.getAttribute("msg");%> 60 | 64 |
65 | 66 | -------------------------------------------------------------------------------- /fks/WebContent/user_home.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=ISO-8859-1" 2 | pageEncoding="ISO-8859-1"%> 3 | 4 | 5 | 6 | 7 | User Home 8 | 10 | 11 | 12 | 13 | 14 | 15 |
17 |

User Home Page

18 |
19 |
20 | <%@include file="/html/user_menu.html"%> 21 |
22 |
23 | 24 | -------------------------------------------------------------------------------- /fks/WebContent/viewsearch.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=ISO-8859-1" 2 | pageEncoding="ISO-8859-1"%> 3 | <%@page import="java.sql.*,fks.dbtasks.*,java.io.*,fks.servlet.*" %> 4 | 5 | 6 | 7 | 8 | Check ID 9 | 11 | 12 | 13 | 14 | 28 | 29 | 30 |
32 |

View Search Result(s)

33 |
34 |
35 | <%@include file="/html/user_menu.html"%> 36 |
37 |
38 | 39 | 40 | 41 | <% 42 | String ms = (String) request.getAttribute("resultMessage"); 43 | HttpSession hs=request.getSession(false); 44 | String uid=(String)hs.getAttribute("userid"); 45 | String sid=request.getParameter("sid"); 46 | String strsql="select * from document"; 47 | ResultSet rs=CrudOperation.fetchData(strsql); 48 | while(rs.next()) 49 | { 50 | String enfname=rs.getString("fname"); 51 | String fname=AES.decrypt(enfname,rs.getString("key")); 52 | String fpath="E:\\upload\\"+enfname; 53 | String fnm=fname.substring(0, fname.indexOf(".")); 54 | if(fnm.equalsIgnoreCase(sid)) 55 | { 56 | %> 57 | 58 | 59 | 60 | 61 | <%} 62 | else if(edst.calculate(sid, fnm)<=3) 63 | { 64 | %> 65 | 66 | 67 | <% String fnme=enfname; %> 68 | 69 | 70 | <%-- <% 71 | if (ms != null) { 72 | %> 73 | 74 | 75 | 77 | 78 | 79 | 80 | 81 | <% 82 | } 83 | %> --%> 84 | <% 85 | } 86 | } 87 | rs.close();%> 88 |
File NameDownload
<%=fname %>">Download
<%=fname %>">Download
Enter OTP
89 |
90 | 91 | -------------------------------------------------------------------------------- /fks/WebContent/viewupfiles.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=ISO-8859-1" 2 | pageEncoding="ISO-8859-1"%> 3 | <%@page import="java.sql.*,fks.dbtasks.*,fks.servlet.*" %> 4 | 5 | 6 | 7 | 8 | View Uploaded Documents 9 | 11 | 12 | 13 | 14 | 28 | 29 | 30 | 31 |
33 |

View Uploaded Documents

34 |
35 |
36 | <%@include file="/html/dataowner_menu.html"%> 37 |
38 |
39 | 40 | 41 | 42 | 43 | 44 | 45 | <% 46 | HttpSession hs=request.getSession(false); 47 | String uid=(String)hs.getAttribute("userid"); 48 | String key=(String)hs.getAttribute("userkey"); 49 | String strsql="select * from document where userid=?"; 50 | ResultSet rs=CrudOperation.fetchData(strsql,uid); 51 | while(rs.next()) 52 | { 53 | %> 54 | 55 | 56 | 57 | 58 | 59 | 60 | <% 61 | } 62 | rs.close();%> 63 |
File NameEncrypted File NameFile PathEncrypted File Path
<%=AES.decrypt(rs.getString("fname"), key) %><%=rs.getString("fname") %><%=AES.decrypt(rs.getString("fpath"), key) %><%=rs.getString("fpath") %>
64 | 65 |
66 | 67 | -------------------------------------------------------------------------------- /fks/src/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Class-Path: 3 | 4 | -------------------------------------------------------------------------------- /fks/src/fks/dbinfo/database.properties: -------------------------------------------------------------------------------- 1 | app.dbuserid=root 2 | app.dbuserpass=root 3 | app.url=jdbc:mysql://localhost:3306/fks 4 | app.tagline=Safe and secure cloud. -------------------------------------------------------------------------------- /fks/src/fks/dbtasks/CrudOperation.java: -------------------------------------------------------------------------------- 1 | package fks.dbtasks; 2 | import java.sql.Connection; 3 | import java.sql.DriverManager; 4 | import java.sql.PreparedStatement; 5 | import java.sql.ResultSet; 6 | import java.sql.SQLException; 7 | import java.util.ResourceBundle; 8 | public class CrudOperation 9 | { 10 | private static Connection cn; 11 | private static PreparedStatement ps; 12 | private static ResultSet rs; 13 | 14 | public static ResultSet fetchData(String sql,int id) 15 | { 16 | cn=createConnection(); 17 | try 18 | { 19 | ps=cn.prepareStatement(sql); 20 | ps.setInt(1, id); 21 | rs=ps.executeQuery(); 22 | } 23 | catch(SQLException se) 24 | { 25 | System.out.println(se); 26 | } 27 | return rs; 28 | } 29 | 30 | public static ResultSet fetchData(String sql,String id) 31 | { 32 | cn=createConnection(); 33 | try 34 | { 35 | ps=cn.prepareStatement(sql); 36 | ps.setString(1, id); 37 | rs=ps.executeQuery(); 38 | } 39 | catch(SQLException se) 40 | { 41 | System.out.println(se); 42 | } 43 | return rs; 44 | } 45 | 46 | public static ResultSet fetchData(String sql) 47 | { 48 | cn=createConnection(); 49 | try 50 | { 51 | ps=cn.prepareStatement(sql); 52 | rs=ps.executeQuery(); 53 | } 54 | catch(SQLException se) 55 | { 56 | System.out.println(se); 57 | } 58 | return rs; 59 | } 60 | 61 | public static Connection createConnection() 62 | { 63 | ResourceBundle rb=ResourceBundle.getBundle("fks/dbinfo/database"); 64 | String dbid=rb.getString("app.dbuserid"); 65 | String dbpass=rb.getString("app.dbuserpass"); 66 | String url=rb.getString("app.url"); 67 | try 68 | { 69 | Class.forName("com.mysql.jdbc.Driver");//factory method used to create obj of a class 70 | cn=DriverManager.getConnection(url,dbid,dbpass); 71 | } //subprotocol ipaddress of machine port no 72 | //connection url or connection string 73 | catch(SQLException|ClassNotFoundException cse) 74 | { 75 | System.out.println(cse); 76 | } 77 | return cn; 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /fks/src/fks/servlet/AES.java: -------------------------------------------------------------------------------- 1 | package fks.servlet; 2 | 3 | import java.io.UnsupportedEncodingException; 4 | import java.security.MessageDigest; 5 | import java.security.NoSuchAlgorithmException; 6 | import java.util.Arrays; 7 | import java.util.Base64; 8 | 9 | import javax.crypto.Cipher; 10 | import javax.crypto.spec.SecretKeySpec; 11 | 12 | public class AES 13 | { 14 | private static SecretKeySpec secretKey; 15 | private static byte[] key; 16 | 17 | public static void setKey(String myKey) 18 | { 19 | MessageDigest sha = null; 20 | try { 21 | key = myKey.getBytes("UTF-8"); 22 | sha = MessageDigest.getInstance("SHA-1"); 23 | key = sha.digest(key); 24 | key = Arrays.copyOf(key, 16); 25 | secretKey = new SecretKeySpec(key, "AES"); 26 | } 27 | catch (NoSuchAlgorithmException e) { 28 | e.printStackTrace(); 29 | } 30 | catch (UnsupportedEncodingException e) { 31 | e.printStackTrace(); 32 | } 33 | } 34 | 35 | public static String encrypt(String strToEncrypt, String secret) 36 | { 37 | try 38 | { 39 | setKey(secret); 40 | Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding"); 41 | cipher.init(Cipher.ENCRYPT_MODE, secretKey); 42 | return Base64.getEncoder().encodeToString(cipher.doFinal(strToEncrypt.getBytes("UTF-8"))); 43 | } 44 | catch (Exception e) 45 | { 46 | System.out.println("Error while encrypting: " + e.toString()); 47 | } 48 | return null; 49 | } 50 | 51 | public static String decrypt(String strToDecrypt, String secret) 52 | { 53 | try 54 | { 55 | setKey(secret); 56 | Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5PADDING"); 57 | cipher.init(Cipher.DECRYPT_MODE, secretKey); 58 | return new String(cipher.doFinal(Base64.getDecoder().decode(strToDecrypt))); 59 | } 60 | catch (Exception e) 61 | { 62 | System.out.println("Error while decrypting: " + e.toString()); 63 | } 64 | return null; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /fks/src/fks/servlet/CryptoException.java: -------------------------------------------------------------------------------- 1 | package fks.servlet; 2 | 3 | 4 | public class CryptoException extends Exception 5 | { 6 | private static final long serialVersionUID = 1L; 7 | public CryptoException() { 8 | } 9 | 10 | public CryptoException(String message, Throwable throwable) { 11 | super(message, throwable); 12 | } 13 | } -------------------------------------------------------------------------------- /fks/src/fks/servlet/CryptoUtils.java: -------------------------------------------------------------------------------- 1 | package fks.servlet; 2 | 3 | import java.io.File; 4 | import java.io.FileInputStream; 5 | import java.io.FileOutputStream; 6 | import java.io.IOException; 7 | import java.security.InvalidKeyException; 8 | import java.security.Key; 9 | import java.security.NoSuchAlgorithmException; 10 | 11 | import javax.crypto.BadPaddingException; 12 | import javax.crypto.Cipher; 13 | import javax.crypto.IllegalBlockSizeException; 14 | import javax.crypto.NoSuchPaddingException; 15 | import javax.crypto.spec.SecretKeySpec; 16 | 17 | public class CryptoUtils { 18 | private static final String ALGORITHM = "AES"; 19 | private static final String TRANSFORMATION = "AES"; 20 | 21 | public static void encrypt(String key, File inputFile, File outputFile) 22 | throws CryptoException { 23 | doCrypto(Cipher.ENCRYPT_MODE, key, inputFile, outputFile); 24 | } 25 | 26 | public static void decrypt(String key, File inputFile, File outputFile) 27 | throws CryptoException { 28 | doCrypto(Cipher.DECRYPT_MODE, key, inputFile, outputFile); 29 | } 30 | 31 | private static void doCrypto(int cipherMode, String key, File inputFile, 32 | File outputFile) throws CryptoException { 33 | try { 34 | Key secretKey = new SecretKeySpec(key.getBytes(), ALGORITHM); 35 | Cipher cipher = Cipher.getInstance(TRANSFORMATION); 36 | cipher.init(cipherMode, secretKey); 37 | 38 | FileInputStream inputStream = new FileInputStream(inputFile); 39 | byte[] inputBytes = new byte[(int) inputFile.length()]; 40 | inputStream.read(inputBytes); 41 | 42 | byte[] outputBytes = cipher.doFinal(inputBytes); 43 | 44 | FileOutputStream outputStream = new FileOutputStream(outputFile); 45 | outputStream.write(outputBytes); 46 | 47 | inputStream.close(); 48 | outputStream.close(); 49 | 50 | } catch (NoSuchPaddingException | NoSuchAlgorithmException 51 | | InvalidKeyException | BadPaddingException 52 | | IllegalBlockSizeException | IOException ex) { 53 | throw new CryptoException("Error encrypting/decrypting file", ex); 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /fks/src/fks/servlet/CryptoUtilsTest.java: -------------------------------------------------------------------------------- 1 | package fks.servlet; 2 | 3 | import java.io.File; 4 | 5 | public class CryptoUtilsTest { 6 | public static void main(String[] args) { 7 | String key = "XzD51lP0QxgP74wt"; 8 | File inputFile = new File("E:\\plrabn12.txt"); 9 | File encryptedFile = new File("E:\\document.txt"); 10 | File decryptedFile = new File("E:\\dec_document.txt"); 11 | try { 12 | CryptoUtils.encrypt(key, inputFile, encryptedFile); 13 | CryptoUtils.decrypt(key, encryptedFile, decryptedFile); 14 | } catch (CryptoException ex) { 15 | System.out.println(ex.getMessage()); 16 | ex.printStackTrace(); 17 | } 18 | finally { 19 | System.out.println(key.length()); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /fks/src/fks/servlet/Document.java: -------------------------------------------------------------------------------- 1 | package fks.servlet; 2 | 3 | import java.io.File; 4 | import java.io.FileNotFoundException; 5 | import java.io.FileOutputStream; 6 | import java.io.IOException; 7 | import java.io.InputStream; 8 | import java.io.OutputStream; 9 | import java.io.PrintWriter; 10 | import java.util.Iterator; 11 | import java.util.List; 12 | 13 | import javax.servlet.ServletException; 14 | import javax.servlet.annotation.WebServlet; 15 | import javax.servlet.http.HttpServlet; 16 | import javax.servlet.http.HttpServletRequest; 17 | import javax.servlet.http.HttpServletResponse; 18 | 19 | import org.apache.commons.fileupload.FileItem; 20 | import org.apache.commons.fileupload.FileItemFactory; 21 | import org.apache.commons.fileupload.disk.DiskFileItemFactory; 22 | import org.apache.commons.fileupload.servlet.ServletFileUpload; 23 | import javax.servlet.ServletContext; 24 | import javax.servlet.annotation.MultipartConfig; 25 | import javax.servlet.http.HttpSession; 26 | import javax.servlet.http.Part; 27 | 28 | import fks.dbtasks.CrudOperation; 29 | import java.sql.*; 30 | /** 31 | * Servlet implementation class PatientReport 32 | */ 33 | @WebServlet("/Document") 34 | @MultipartConfig 35 | public class Document extends HttpServlet { 36 | private static final long serialVersionUID = 1L; 37 | private Connection cn,con; 38 | private PreparedStatement ps; 39 | 40 | public Document() { 41 | super(); 42 | // TODO Auto-generated constructor stub 43 | } 44 | 45 | /** 46 | * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) 47 | */ 48 | 49 | protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException 50 | { 51 | String disk="E:\\upload\\"; 52 | String file_name=null; 53 | try 54 | { 55 | PrintWriter out=response.getWriter(); 56 | response.setContentType("text/html;charset=UTF-8"); 57 | 58 | HttpSession hs = request.getSession(false); 59 | String uid = (String) hs.getAttribute("userid"); 60 | boolean isMultiPartContent=ServletFileUpload.isMultipartContent(request); 61 | if(!isMultiPartContent) 62 | { 63 | return; 64 | } 65 | ServletFileUpload sf=new ServletFileUpload(new DiskFileItemFactory()); 66 | FileItemFactory factory=new DiskFileItemFactory(); 67 | ServletFileUpload upload=new ServletFileUpload(factory); 68 | 69 | List fields=upload.parseRequest(request); 70 | Iterator it=fields.iterator(); 71 | if(!it.hasNext()) { 72 | return; 73 | } 74 | while(it.hasNext()) 75 | { 76 | FileItem fileItem=it.next(); 77 | boolean isFormField=fileItem.isFormField(); 78 | if(isFormField) 79 | { 80 | if(file_name==null) { 81 | if(fileItem.getFieldName().equals("file_name")) { 82 | file_name=fileItem.getString(); 83 | } 84 | } 85 | } 86 | else { 87 | if(fileItem.getSize()>0) { 88 | String query="insert into document values(?,?,?)"; 89 | 90 | try { 91 | con = CrudOperation.createConnection(); 92 | ps = con.prepareStatement(query); 93 | ps=cn.prepareStatement(query); 94 | ps.setString(1,uid); 95 | ps.setString(2,fileItem.getName()); 96 | ps.setString(3,disk+fileItem.getName()); 97 | System.out.println(ps); 98 | int rw = ps.executeUpdate(); 99 | if (rw > 0) 100 | { 101 | fileItem.write(new File(disk+fileItem.getName())); 102 | System.out.println("Document(s) successfully uploaded"); 103 | response.sendRedirect("/fks/jsp/docupload.jsp"); 104 | } 105 | } catch (SQLException se) { 106 | 107 | System.out.println(se); 108 | } 109 | 110 | } 111 | } 112 | 113 | } 114 | } 115 | catch(Exception e) 116 | { 117 | System.out.println(e); 118 | } 119 | } 120 | /*request.getParameter("text/html"); 121 | PrintWriter out=response.getWriter(); 122 | String userid=request.getParameter("txtuserid"); 123 | String fname=request.getParameter("txtfilename"); 124 | 125 | response.setContentType("text/html;charset=UTF-8"); 126 | ServletContext sc = getServletContext(); 127 | String path = sc.getRealPath("/"); 128 | 129 | System.out.println(path); 130 | 131 | HttpSession hs = request.getSession(false); 132 | String u_id = (String) hs.getAttribute("userkey"); 133 | 134 | String newpath = path + u_id; 135 | File f1 = new File(newpath); 136 | if (!f1.exists()) { 137 | 138 | f1.mkdir(); 139 | } 140 | 141 | System.out.println("directorycreated"); 142 | 143 | 144 | * String description = request.getParameter("txtdesc"); 145 | * System.out.println(description); 146 | 147 | 148 | final Part filePart = request.getPart("txtrep");//filecontrol 149 | final String fileName = getFileName(filePart); 150 | 151 | String query="insert into document values(?,?,?)"; 152 | 153 | try { 154 | con = CrudOperation.createConnection(); 155 | ps = con.prepareStatement(query); 156 | ps=cn.prepareStatement(query); 157 | ps.setString(1,userid); 158 | ps.setString(2,fname); 159 | ps.setString(3,fileName); 160 | System.out.println(ps); 161 | int rw = ps.executeUpdate(); 162 | if (rw > 0) { 163 | 164 | System.out.println("Document Uploaded"); 165 | response.sendRedirect("/fks/jsp/docupload.jsp"); 166 | } 167 | 168 | } catch (SQLException se) { 169 | 170 | System.out.println(se); 171 | } 172 | 173 | System.out.println(fileName); 174 | 175 | OutputStream out = null; 176 | InputStream filecontent = null; 177 | final PrintWriter writer = response.getWriter(); 178 | 179 | try { 180 | out = new FileOutputStream(new File(newpath + File.separator + fileName)); 181 | filecontent = filePart.getInputStream(); 182 | 183 | int read = 0; 184 | final byte[] bytes = new byte[1024]; 185 | 186 | while ((read = filecontent.read(bytes)) != -1) { 187 | out.write(bytes, 0, read); 188 | } 189 | // writer.println("New file " + fileName + " created at " + newpath); 190 | 191 | } catch (FileNotFoundException fne) { 192 | 193 | writer.println("
ERROR: " + fne.getMessage()); 194 | 195 | } finally { 196 | if (out != null) { 197 | out.close(); 198 | } 199 | if (filecontent != null) { 200 | filecontent.close(); 201 | } 202 | if (writer != null) { 203 | writer.close(); 204 | } 205 | } 206 | } 207 | 208 | private String getFileName(final Part part) { 209 | 210 | final String partHeader = part.getHeader("content-disposition"); 211 | 212 | for (String content : part.getHeader("content-disposition").split(";")) { 213 | if (content.trim().startsWith("filename")) { 214 | return content.substring(content.indexOf('=') + 1).trim().replace("\"", ""); 215 | } 216 | } 217 | return null; 218 | }*/ 219 | 220 | 221 | 222 | 223 | } 224 | 225 | 226 | -------------------------------------------------------------------------------- /fks/src/fks/servlet/EditProfile.java: -------------------------------------------------------------------------------- 1 | package fks.servlet; 2 | 3 | import java.io.IOException; 4 | 5 | import javax.servlet.RequestDispatcher; 6 | import javax.servlet.ServletException; 7 | import javax.servlet.annotation.WebServlet; 8 | import javax.servlet.http.HttpServlet; 9 | import javax.servlet.http.HttpServletRequest; 10 | import javax.servlet.http.HttpServletResponse; 11 | import javax.servlet.http.HttpSession; 12 | 13 | import fks.dbtasks.CrudOperation; 14 | import fks.servlet.AES; 15 | import java.sql.*; 16 | 17 | /** 18 | * Servlet implementation class EditProfile 19 | */ 20 | @WebServlet("/EditProfile") 21 | public class EditProfile extends HttpServlet { 22 | private static final long serialVersionUID = 1L; 23 | private Connection cn; 24 | private PreparedStatement ps; 25 | /** 26 | * @see HttpServlet#HttpServlet() 27 | */ 28 | public EditProfile() { 29 | super(); 30 | // TODO Auto-generated constructor stub 31 | } 32 | 33 | /** 34 | * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) 35 | */ 36 | protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException 37 | { 38 | // TODO Auto-generated method stub 39 | request.getParameter("text/html"); 40 | HttpSession hs=request.getSession(false); 41 | String uid=(String)hs.getAttribute("userid"); 42 | String upass=(String)hs.getAttribute("userpass"); 43 | String role=(String)hs.getAttribute("role"); 44 | String entpass=request.getParameter("pass"); 45 | final String key="ssshhhhhhhhhhh!!!!"; 46 | if(entpass.equals(upass)) 47 | { 48 | String uname=request.getParameter("txtusername"); 49 | String mail=request.getParameter("txtmail"); 50 | try { 51 | cn=CrudOperation.createConnection(); 52 | cn.setAutoCommit(false); 53 | String login="update logininfo set username=?, email=? where userid=?"; 54 | ps=cn.prepareStatement(login); 55 | ps.setString(1,AES.encrypt(uname, key)); 56 | ps.setString(2,AES.encrypt(mail, key)); 57 | ps.setString(3,uid); 58 | int rw = ps.executeUpdate(); 59 | if (rw > 0) 60 | { 61 | cn.commit(); 62 | request.setAttribute("msg", "Profile updated successfully"); 63 | if(role.equals("dataowner")) 64 | { 65 | RequestDispatcher rd=request.getRequestDispatcher("/doedit.jsp"); 66 | rd.forward(request, response); 67 | } 68 | else 69 | { 70 | RequestDispatcher rd=request.getRequestDispatcher("/uedit.jsp"); 71 | rd.forward(request, response); 72 | } 73 | } 74 | } 75 | catch (SQLException se) 76 | { 77 | System.out.println(se); 78 | } 79 | } 80 | else 81 | { 82 | request.setAttribute("msg", "Wrong Password"); 83 | if(role.equals("dataowner")) 84 | { 85 | RequestDispatcher rd=request.getRequestDispatcher("/doedit.jsp"); 86 | rd.forward(request, response); 87 | } 88 | else 89 | { 90 | RequestDispatcher rd=request.getRequestDispatcher("/uedit.jsp"); 91 | rd.forward(request, response); 92 | } 93 | } 94 | } 95 | } -------------------------------------------------------------------------------- /fks/src/fks/servlet/EmailUtility.java: -------------------------------------------------------------------------------- 1 | package fks.servlet; 2 | 3 | import java.util.Date; 4 | import java.util.Properties; 5 | 6 | import javax.mail.Authenticator; 7 | import javax.mail.Message; 8 | import javax.mail.MessagingException; 9 | import javax.mail.PasswordAuthentication; 10 | import javax.mail.Session; 11 | import javax.mail.Transport; 12 | import javax.mail.internet.AddressException; 13 | import javax.mail.internet.InternetAddress; 14 | import javax.mail.internet.MimeMessage; 15 | 16 | public class EmailUtility { 17 | public static void sendEmail(String host, String port, 18 | final String userName, final String password, String toAddress, 19 | String subject, String message) throws AddressException, 20 | MessagingException { 21 | 22 | // sets SMTP server properties 23 | Properties properties = new Properties(); 24 | properties.put("mail.smtp.host", host); 25 | properties.put("mail.smtp.port", port); 26 | properties.put("mail.smtp.ssl.trust", "smtp.gmail.com"); 27 | properties.put("mail.smtp.auth", "true"); 28 | properties.put("mail.smtp.starttls.enable", "true"); 29 | 30 | // creates a new session with an authenticator 31 | Authenticator auth = new Authenticator() { 32 | public PasswordAuthentication getPasswordAuthentication() { 33 | return new PasswordAuthentication(userName, password); 34 | } 35 | }; 36 | 37 | Session session = Session.getInstance(properties, auth); 38 | 39 | // creates a new e-mail message 40 | Message msg = new MimeMessage(session); 41 | 42 | msg.setFrom(new InternetAddress(userName)); 43 | InternetAddress[] toAddresses = { new InternetAddress(toAddress) }; 44 | msg.setRecipients(Message.RecipientType.TO, toAddresses); 45 | msg.setSubject(subject); 46 | msg.setSentDate(new Date()); 47 | msg.setText(message); 48 | 49 | Transport.send(msg); 50 | 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /fks/src/fks/servlet/FileUploadHandle.java: -------------------------------------------------------------------------------- 1 | package fks.servlet; 2 | 3 | import java.io.File; 4 | import java.io.IOException; 5 | import java.io.PrintWriter; 6 | import java.util.Iterator; 7 | import java.util.List; 8 | 9 | import javax.servlet.ServletException; 10 | import javax.servlet.annotation.WebServlet; 11 | import javax.servlet.http.HttpServlet; 12 | import javax.servlet.http.HttpServletRequest; 13 | import javax.servlet.http.HttpServletResponse; 14 | import javax.servlet.http.HttpSession; 15 | 16 | import org.apache.commons.fileupload.FileItem; 17 | import org.apache.commons.fileupload.FileItemFactory; 18 | import org.apache.commons.fileupload.disk.DiskFileItemFactory; 19 | import org.apache.commons.fileupload.servlet.ServletFileUpload; 20 | 21 | import fks.servlet.AES; 22 | import fks.dbtasks.CrudOperation; 23 | import java.sql.*; 24 | /** 25 | * Servlet implementation class FileUploadHandle 26 | */ 27 | @WebServlet("/FileUploadHandle") 28 | public class FileUploadHandle extends HttpServlet { 29 | private static final long serialVersionUID = 1L; 30 | private Connection con; 31 | private PreparedStatement ps; 32 | /** 33 | * @see HttpServlet#HttpServlet() 34 | */ 35 | public FileUploadHandle() { 36 | super(); 37 | // TODO Auto-generated constructor stub 38 | } 39 | /** 40 | * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) 41 | */ 42 | protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { 43 | // TODO Auto-generated method stub 44 | response.getWriter().append("Served at: ").append(request.getContextPath()); 45 | } 46 | 47 | /** 48 | * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) 49 | */ 50 | protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { 51 | 52 | String file_name = null; 53 | response.setContentType("text/html"); 54 | PrintWriter out = response.getWriter(); 55 | boolean isMultipartContent = ServletFileUpload.isMultipartContent(request); 56 | if (!isMultipartContent) { 57 | return; 58 | } 59 | FileItemFactory factory = new DiskFileItemFactory(); 60 | ServletFileUpload upload = new ServletFileUpload(factory); 61 | try { 62 | List < FileItem > fields = upload.parseRequest(request); 63 | Iterator < FileItem > it = fields.iterator(); 64 | if (!it.hasNext()) { 65 | return; 66 | } 67 | while (it.hasNext()) { 68 | FileItem fileItem = it.next(); 69 | boolean isFormField = fileItem.isFormField(); 70 | if (isFormField) { 71 | if (file_name == null) { 72 | if (fileItem.getFieldName().equals("txtfilename")) { 73 | file_name = fileItem.getString(); 74 | } 75 | } 76 | } else { 77 | if (fileItem.getSize() > 0) { 78 | HttpSession hs = request.getSession(false); 79 | String uid = (String) hs.getAttribute("userid"); 80 | String key = (String) hs.getAttribute("userkey"); 81 | String query="insert into document values(?,?,?,?)"; 82 | 83 | try { 84 | String enfname = AES.encrypt(fileItem.getName(), key) ; 85 | //System.out.println(enfname); 86 | String enfpath = AES.encrypt("E:\\upload\\"+fileItem.getName(), key) ; 87 | //System.out.println(enfpath); 88 | con = CrudOperation.createConnection(); 89 | ps = con.prepareStatement(query); 90 | ps.setString(1,uid); 91 | ps.setString(2,enfname); 92 | ps.setString(3,enfpath); 93 | ps.setString(4,key); 94 | //System.out.println(ps); 95 | fileItem.write(new File("E:\\upload\\" + fileItem.getName())); 96 | File inputFile = new File("E:\\upload\\" + fileItem.getName()); 97 | File encryptedFile = new File("E:\\upload\\" + enfname); 98 | 99 | try 100 | { 101 | CryptoUtils.encrypt(key, inputFile, encryptedFile); 102 | inputFile.delete(); 103 | } 104 | catch (CryptoException ex) { 105 | System.out.println(ex.getMessage()); 106 | ex.printStackTrace(); 107 | } 108 | 109 | int rw = ps.executeUpdate(); 110 | if (rw > 0) 111 | { 112 | System.out.println("Document(s) successfully uploaded."); 113 | } 114 | 115 | } catch (SQLException se) { 116 | 117 | System.out.println(se); 118 | } 119 | 120 | 121 | } 122 | } 123 | } 124 | } catch (Exception e) { 125 | e.printStackTrace(); 126 | } finally { 127 | out.println(""); 130 | out.close(); 131 | } 132 | } 133 | 134 | } 135 | -------------------------------------------------------------------------------- /fks/src/fks/servlet/Login.java: -------------------------------------------------------------------------------- 1 | package fks.servlet; 2 | 3 | import java.io.IOException; 4 | import java.sql.Connection; 5 | import java.sql.PreparedStatement; 6 | import java.sql.ResultSet; 7 | import java.sql.SQLException; 8 | 9 | import javax.servlet.RequestDispatcher; 10 | import javax.servlet.ServletException; 11 | import javax.servlet.annotation.WebServlet; 12 | import javax.servlet.http.HttpServlet; 13 | import javax.servlet.http.HttpServletRequest; 14 | import javax.servlet.http.HttpServletResponse; 15 | import javax.servlet.http.HttpSession; 16 | 17 | import fks.servlet.AES; 18 | import fks.dbtasks.CrudOperation; 19 | /** 20 | * Servlet implementation class Login 21 | */ 22 | @WebServlet("/Login") 23 | public class Login extends HttpServlet { 24 | private static final long serialVersionUID = 1L; 25 | private Connection cn; 26 | private PreparedStatement pslogin; 27 | private ResultSet rslogin; 28 | 29 | /** 30 | * @see HttpServlet#HttpServlet() 31 | */ 32 | public Login() { 33 | super(); 34 | // TODO Auto-generated constructor stub 35 | } 36 | 37 | 38 | protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { 39 | } 40 | 41 | /** 42 | * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) 43 | */ 44 | protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException 45 | { 46 | String id=request.getParameter("txtuserid").trim(); 47 | String pass=request.getParameter("txtuserpass"); 48 | cn=CrudOperation.createConnection(); 49 | String strsql="select * from logininfo where userid=?"; 50 | try 51 | { 52 | pslogin=cn.prepareStatement(strsql); 53 | pslogin.setString(1, id); 54 | rslogin=pslogin.executeQuery(); 55 | if(rslogin.next()) 56 | { 57 | String enpass=rslogin.getString("userpass"); 58 | final String secretKey = "ssshhhhhhhhhhh!!!!"; 59 | String depass = AES.decrypt(enpass, secretKey); 60 | if(depass.equals(pass)) 61 | { 62 | HttpSession hs=request.getSession(); //create new session 63 | String utype=rslogin.getString("role"); 64 | String umail=rslogin.getString("email"); 65 | hs.setAttribute("userid", id); 66 | hs.setAttribute("userpass", utype); 67 | hs.setAttribute("usermail", umail); 68 | if(utype.equalsIgnoreCase("dataowner")) 69 | { 70 | String key=rslogin.getString("key"); 71 | hs.setAttribute("userkey", key); 72 | response.sendRedirect("/fks/dataowner_home.jsp"); 73 | } 74 | else if(utype.equalsIgnoreCase("user")) 75 | response.sendRedirect("/fks/user_home.jsp"); 76 | else if(utype.equalsIgnoreCase("cloudadmin")) 77 | response.sendRedirect("/fks/cloud_home.jsp"); 78 | } 79 | else 80 | { 81 | request.setAttribute("msg", "Invalid Password"); 82 | RequestDispatcher rd=request.getRequestDispatcher("/login.jsp"); 83 | rd.forward(request, response); 84 | } 85 | } 86 | else 87 | { 88 | request.setAttribute("msg", "Invalid UserID or Password"); 89 | RequestDispatcher rd=request.getRequestDispatcher("/login.jsp"); 90 | rd.forward(request, response); 91 | } 92 | } 93 | catch(SQLException se) 94 | { 95 | System.out.println(se); 96 | } 97 | 98 | 99 | } 100 | 101 | } 102 | /*FileUploadServletExample 103 | 104 | FileUpload 105 | FileUpload 106 | fks.servlet.FileUpload 107 | 108 | 109 | FileUpload 110 | /uploadFile 111 | */ 112 | 113 | -------------------------------------------------------------------------------- /fks/src/fks/servlet/Logoff.java: -------------------------------------------------------------------------------- 1 | package fks.servlet; 2 | 3 | import java.io.IOException; 4 | import javax.servlet.ServletException; 5 | import javax.servlet.annotation.WebServlet; 6 | import javax.servlet.http.HttpServlet; 7 | import javax.servlet.http.HttpServletRequest; 8 | import javax.servlet.http.HttpServletResponse; 9 | import javax.servlet.http.HttpSession; 10 | 11 | /** 12 | * Servlet implementation class Logoff 13 | */ 14 | @WebServlet("/Logoff") 15 | public class Logoff extends HttpServlet { 16 | private static final long serialVersionUID = 1L; 17 | 18 | /** 19 | * @see HttpServlet#HttpServlet() 20 | */ 21 | public Logoff() { 22 | super(); 23 | // TODO Auto-generated constructor stub 24 | } 25 | 26 | /** 27 | * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) 28 | */ 29 | protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException 30 | { 31 | doPost(request,response); 32 | } 33 | 34 | /** 35 | * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) 36 | */ 37 | protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException 38 | { 39 | HttpSession hs=request.getSession(false); 40 | String ui=(String)hs.getAttribute("userid"); 41 | hs.removeAttribute("userid"); 42 | hs.invalidate();//destroys the session for current user 43 | response.sendRedirect("/fks/login.jsp"); 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /fks/src/fks/servlet/Reg.java: -------------------------------------------------------------------------------- 1 | package fks.servlet; 2 | 3 | import java.io.IOException; 4 | import java.io.PrintWriter; 5 | import java.sql.SQLException; 6 | 7 | import javax.servlet.ServletContext; 8 | import javax.servlet.ServletException; 9 | import javax.servlet.annotation.WebServlet; 10 | import javax.servlet.http.HttpServlet; 11 | import javax.servlet.http.HttpServletRequest; 12 | import javax.servlet.http.HttpServletResponse; 13 | 14 | import java.io.UnsupportedEncodingException; 15 | import java.nio.charset.Charset; 16 | import java.security.MessageDigest; 17 | import java.security.NoSuchAlgorithmException; 18 | import java.util.Arrays; 19 | import java.util.Base64; 20 | import java.util.Random; 21 | 22 | import javax.crypto.Cipher; 23 | import javax.crypto.spec.SecretKeySpec; 24 | 25 | import fks.dbtasks.CrudOperation; 26 | import fks.servlet.EmailUtility; 27 | 28 | import java.sql.*; 29 | /** 30 | * Servlet implementation class PatientRegistration 31 | */ 32 | @WebServlet("/Reg") 33 | public class Reg extends HttpServlet { 34 | private static final long serialVersionUID = 1L; 35 | private Connection cn; 36 | private PreparedStatement ps1,ps2; 37 | private String host; 38 | private String port; 39 | private String user; 40 | private String pass; 41 | 42 | public void init() { 43 | // reads SMTP server setting from web.xml file 44 | ServletContext context = getServletContext(); 45 | host = context.getInitParameter("host"); 46 | port = context.getInitParameter("port"); 47 | user = context.getInitParameter("user"); 48 | pass = context.getInitParameter("pass"); 49 | } 50 | 51 | /** 52 | * @see HttpServlet#HttpServlet() 53 | */ 54 | public Reg() { 55 | super(); 56 | // TODO Auto-generated constructor stub 57 | } 58 | 59 | public static String getAlphaNumericString(int n) 60 | { 61 | byte[] array = new byte[256]; 62 | new Random().nextBytes(array); 63 | 64 | String randomString 65 | = new String(array, Charset.forName("UTF-8")); 66 | 67 | StringBuffer r = new StringBuffer(); 68 | 69 | for (int k = 0; k < randomString.length(); k++) { 70 | 71 | char ch = randomString.charAt(k); 72 | 73 | if (((ch >= 'a' && ch <= 'z') 74 | || (ch >= 'A' && ch <= 'Z') 75 | || (ch >= '0' && ch <= '9')) 76 | && (n > 0)) { 77 | 78 | r.append(ch); 79 | n--; 80 | } 81 | } 82 | return r.toString(); 83 | } 84 | 85 | /** 86 | * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) 87 | */ 88 | protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { 89 | // TODO Auto-generated method stub 90 | response.getWriter().append("Served at: ").append(request.getContextPath()); 91 | } 92 | 93 | /** 94 | * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) 95 | */ 96 | protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException 97 | { 98 | request.getParameter("text/html"); 99 | PrintWriter out=response.getWriter(); 100 | String id=request.getParameter("txtuserid"); 101 | String ps=request.getParameter("pass"); 102 | String name=request.getParameter("txtusername"); 103 | String mail=request.getParameter("txtmail"); 104 | String role=request.getParameter("role"); 105 | 106 | final String secretKey = "ssshhhhhhhhhhh!!!!"; 107 | 108 | String enpass = AES.encrypt(ps, secretKey) ; 109 | String enname = AES.encrypt(name, secretKey) ; 110 | String enmail = AES.encrypt(mail, secretKey) ; 111 | String resultMessage = ""; 112 | //System.out.println(id); 113 | //System.out.println(enpass); 114 | 115 | try { 116 | cn=CrudOperation.createConnection(); 117 | cn.setAutoCommit(false); 118 | String login="insert into logininfo values(?,?,?,?,?,?)"; 119 | ps1=cn.prepareStatement(login); 120 | ps1.setString(1,id); 121 | ps1.setString(2,enpass); 122 | ps1.setString(3,enname); 123 | ps1.setString(4,enmail); 124 | ps1.setString(5,role); 125 | if(role.equalsIgnoreCase("user")) 126 | { 127 | ps1.setString(6,null); 128 | String auth="insert into auth values(?,?)"; 129 | ps2=cn.prepareStatement(auth); 130 | ps2.setString(1, id); 131 | ps2.setString(2, "no"); 132 | ps2.executeUpdate(); 133 | } 134 | else 135 | ps1.setString(6,getAlphaNumericString(16)); 136 | int rw = ps1.executeUpdate(); 137 | if (rw > 0) 138 | { 139 | cn.commit(); 140 | EmailUtility.sendEmail(host, port, user, pass, mail, "Welcome to our platform as a "+role, 141 | "Hi, "+name+"\nYour User ID: "+id+"\nYour password: "+ps); 142 | resultMessage = "Registration successful, you will receive an e-mail shortly."; 143 | } 144 | } 145 | catch (SQLException se) 146 | { 147 | System.out.println(se); 148 | } 149 | catch (Exception ex) 150 | { 151 | ex.printStackTrace(); 152 | resultMessage = "There were an error: " + ex.getMessage(); 153 | } 154 | finally 155 | { 156 | request.setAttribute("Message", resultMessage); 157 | getServletContext().getRequestDispatcher("/Result.jsp").forward( 158 | request, response); 159 | } 160 | 161 | } 162 | 163 | } 164 | -------------------------------------------------------------------------------- /fks/src/fks/servlet/edst.java: -------------------------------------------------------------------------------- 1 | package fks.servlet; 2 | 3 | import java.util.Arrays; 4 | 5 | public class edst 6 | { 7 | public static int calculate(String x, String y) 8 | { 9 | if (x.isEmpty()) { 10 | return y.length(); 11 | } 12 | 13 | if (y.isEmpty()) { 14 | return x.length(); 15 | } 16 | 17 | int substitution = calculate(x.substring(1), y.substring(1)) 18 | + costOfSubstitution(x.charAt(0), y.charAt(0)); 19 | int insertion = calculate(x, y.substring(1)) + 1; 20 | int deletion = calculate(x.substring(1), y) + 1; 21 | 22 | return min(substitution, insertion, deletion); 23 | } 24 | 25 | public static int costOfSubstitution(char a, char b) 26 | { 27 | return a == b ? 0 : 1; 28 | } 29 | 30 | public static int min(int... numbers) 31 | { 32 | return Arrays.stream(numbers) 33 | .min().orElse(Integer.MAX_VALUE); 34 | } 35 | } 36 | --------------------------------------------------------------------------------