{"id":19160,"date":"2013-11-25T01:00:25","date_gmt":"2013-11-24T23:00:25","guid":{"rendered":"http:\/\/www.javacodegeeks.com\/?p=19160"},"modified":"2013-11-25T00:08:59","modified_gmt":"2013-11-24T22:08:59","slug":"mongodb-gridfs-remove-method-deletes-all-files-in-bucket","status":"publish","type":"post","link":"https:\/\/www.javacodegeeks.com\/2013\/11\/mongodb-gridfs-remove-method-deletes-all-files-in-bucket.html","title":{"rendered":"MongoDB: GridFS remove method deletes all files in bucket"},"content":{"rendered":"<p>Some time ago we ran into strange behaviour of <a href=\"http:\/\/www.mongodb.org\/\">MongoDB&#8217;s<\/a> <a href=\"http:\/\/docs.mongodb.org\/manual\/core\/gridfs\/\">GridFS<\/a> which caused me creating a <a href=\"https:\/\/jira.mongodb.org\/browse\/JAVA-863\">Bug Ticket<\/a> for the MongoDB Java driver.<\/p>\n<p>Today I found the link to the bug ticket in my browser bookmarks. The ticket isn&#8217;t solved at the current time so I thought it would be worth a short blog post in case someone else runs into this problem.<\/p>\n<p>Let&#8217;s look at the following simplified Java service:<br \/>\n&nbsp;<br \/>\n&nbsp;<br \/>\n&nbsp;<\/p>\n<pre class=\" brush:java\">public\u00a0class\u00a0GridFsService\u00a0{\r\n\r\n\u00a0\u00a0private\u00a0GridFS\u00a0gridFs;\r\n\r\n\u00a0\u00a0public\u00a0void\u00a0connect(String\u00a0mongoDbHost,\u00a0String\u00a0databaseName)\u00a0throws\u00a0UnknownHostException\u00a0{\r\n\u00a0\u00a0\u00a0\u00a0DB\u00a0db\u00a0=\u00a0Mongo.connect(new\u00a0DBAddress(mongoDbHost,\u00a0databaseName));\r\n\u00a0\u00a0\u00a0\u00a0this.gridFs\u00a0=\u00a0new\u00a0GridFS(db,\u00a0\"myBucket\");\r\n\u00a0\u00a0}\r\n\r\n\u00a0\u00a0public\u00a0void\u00a0removeGridFsFile(String\u00a0id)\u00a0{\r\n\u00a0\u00a0\u00a0\u00a0GridFSDBFile\u00a0file\u00a0=\u00a0this.gridFs.findOne(new\u00a0ObjectId(id));\r\n\u00a0\u00a0\u00a0\u00a0this.gridFs.remove(file);\r\n\u00a0\u00a0}\r\n\r\n\u00a0\u00a0\/\/\u00a0..\u00a0other\u00a0methods\u00a0to\u00a0create\u00a0and\u00a0update\u00a0files\r\n}<\/pre>\n<p>This service uses the MongoDB Java driver to create, update and remove files from GridFS. However, there is a serious flaw in the removeGridFsFile() method. Guess what happens if an invalid id is passed to removeGridFsFile(). gridFs.findOne() returns null for non existent ids. So null is passed to gridFs.remove() which then<b> removes all files in the current bucket<\/b>.<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<p>Fixing this is easy. Just add a null check or use another GridFS remove() method that takes an ObjectId instead of a GridFsDBFile:<\/p>\n<pre class=\" brush:java\">public\u00a0void\u00a0removeGridFsFile(String\u00a0id)\u00a0{\r\n\u00a0\u00a0this.gridFs.remove(new\u00a0ObjectId(id));\r\n}<\/pre>\n<p>Using this way everything works fine if an invalid id is passed to removeGridFsFile() (no file is removed). To make sure this won&#8217;t happen again I tested what happens if null is passed to any of the three different remove() methods:<\/p>\n<pre class=\" brush:java\">gridFs.remove((String)null);\u00a0\u00a0  \u00a0 \/\/\u00a0nothing\u00a0happens\r\ngridFs.remove((ObjectId)null);\u00a0\u00a0\u00a0\u00a0\/\/\u00a0nothing\u00a0happens\r\ngridFs.remove((DBObject)null);\u00a0\u00a0\u00a0\u00a0\/\/\u00a0all\u00a0files\u00a0from\u00a0bucket\u00a0are\u00a0removed<\/pre>\n<p>I don&#8217;t know if this is intended behaviour. The <a href=\"http:\/\/api.mongodb.org\/java\/current\/com\/mongodb\/gridfs\/GridFS.html#remove%28com.mongodb.DBObject%29\">Javadoc comment<\/a> for gridFs.remove(DBObject query) tells me that it <i>removes all files matching the given query<\/i>. However, if it is intended I think it should be clearly stated in the javadoc comment that passing null removes all files in the bucket.<br \/>\n&nbsp;<\/p>\n<div style=\"border: 1px solid #D8D8D8; background: #FAFAFA; width: 100%; padding-left: 5px;\"><b><i>Reference: <\/i><\/b><a href=\"http:\/\/www.mscharhag.com\/2013\/08\/gridfss-remove-method-deletes-all-files.html\">MongoDB: GridFS remove method deletes all files in bucket<\/a> from our <a href=\"http:\/\/www.javacodegeeks.com\/jcg\">JCG partner<\/a> Michael Scharhag at the <a href=\"http:\/\/www.mscharhag.com\/\">mscharhag, Programming and Stuff<\/a> blog.<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Some time ago we ran into strange behaviour of MongoDB&#8217;s GridFS which caused me creating a Bug Ticket for the MongoDB Java driver. Today I found the link to the bug ticket in my browser bookmarks. The ticket isn&#8217;t solved at the current time so I thought it would be worth a short blog post &hellip;<\/p>\n","protected":false},"author":514,"featured_media":187,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[112],"class_list":["post-19160","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-enterprise-java","tag-mongodb"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>MongoDB: GridFS remove method deletes all files in bucket<\/title>\n<meta name=\"description\" content=\"Some time ago we ran into strange behaviour of MongoDB&#039;s GridFS which caused me creating a Bug Ticket for the MongoDB Java driver. Today I found the link\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.javacodegeeks.com\/2013\/11\/mongodb-gridfs-remove-method-deletes-all-files-in-bucket.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"MongoDB: GridFS remove method deletes all files in bucket\" \/>\n<meta property=\"og:description\" content=\"Some time ago we ran into strange behaviour of MongoDB&#039;s GridFS which caused me creating a Bug Ticket for the MongoDB Java driver. Today I found the link\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.javacodegeeks.com\/2013\/11\/mongodb-gridfs-remove-method-deletes-all-files-in-bucket.html\" \/>\n<meta property=\"og:site_name\" content=\"Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2013-11-24T23:00:25+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/mongodb-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Michael Scharhag\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/mscharhag\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Michael Scharhag\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/11\\\/mongodb-gridfs-remove-method-deletes-all-files-in-bucket.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/11\\\/mongodb-gridfs-remove-method-deletes-all-files-in-bucket.html\"},\"author\":{\"name\":\"Michael Scharhag\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/0f0f81e875d40e3f820392e0ffce65d1\"},\"headline\":\"MongoDB: GridFS remove method deletes all files in bucket\",\"datePublished\":\"2013-11-24T23:00:25+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/11\\\/mongodb-gridfs-remove-method-deletes-all-files-in-bucket.html\"},\"wordCount\":288,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/11\\\/mongodb-gridfs-remove-method-deletes-all-files-in-bucket.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/mongodb-logo.jpg\",\"keywords\":[\"MongoDB\"],\"articleSection\":[\"Enterprise Java\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/11\\\/mongodb-gridfs-remove-method-deletes-all-files-in-bucket.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/11\\\/mongodb-gridfs-remove-method-deletes-all-files-in-bucket.html\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/11\\\/mongodb-gridfs-remove-method-deletes-all-files-in-bucket.html\",\"name\":\"MongoDB: GridFS remove method deletes all files in bucket\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/11\\\/mongodb-gridfs-remove-method-deletes-all-files-in-bucket.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/11\\\/mongodb-gridfs-remove-method-deletes-all-files-in-bucket.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/mongodb-logo.jpg\",\"datePublished\":\"2013-11-24T23:00:25+00:00\",\"description\":\"Some time ago we ran into strange behaviour of MongoDB's GridFS which caused me creating a Bug Ticket for the MongoDB Java driver. Today I found the link\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/11\\\/mongodb-gridfs-remove-method-deletes-all-files-in-bucket.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/11\\\/mongodb-gridfs-remove-method-deletes-all-files-in-bucket.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/11\\\/mongodb-gridfs-remove-method-deletes-all-files-in-bucket.html#primaryimage\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/mongodb-logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/mongodb-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/11\\\/mongodb-gridfs-remove-method-deletes-all-files-in-bucket.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Enterprise Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\\\/enterprise-java\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"MongoDB: GridFS remove method deletes all files in bucket\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Developers Resource Center\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.javacodegeeks.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/javacodegeeks\",\"https:\\\/\\\/x.com\\\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/0f0f81e875d40e3f820392e0ffce65d1\",\"name\":\"Michael Scharhag\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/52283459bfc820fb6a66704b3eccc771a1d8a63a0bdbbe1651bb5cb383a42148?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/52283459bfc820fb6a66704b3eccc771a1d8a63a0bdbbe1651bb5cb383a42148?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/52283459bfc820fb6a66704b3eccc771a1d8a63a0bdbbe1651bb5cb383a42148?s=96&d=mm&r=g\",\"caption\":\"Michael Scharhag\"},\"description\":\"Michael Scharhag is a Java Developer, Blogger and technology enthusiast. Particularly interested in Java related technologies including Java EE, Spring, Groovy and Grails.\",\"sameAs\":[\"http:\\\/\\\/www.mscharhag.com\\\/\",\"https:\\\/\\\/x.com\\\/https:\\\/\\\/twitter.com\\\/mscharhag\"],\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/author\\\/michael-scharhag\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"MongoDB: GridFS remove method deletes all files in bucket","description":"Some time ago we ran into strange behaviour of MongoDB's GridFS which caused me creating a Bug Ticket for the MongoDB Java driver. Today I found the link","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.javacodegeeks.com\/2013\/11\/mongodb-gridfs-remove-method-deletes-all-files-in-bucket.html","og_locale":"en_US","og_type":"article","og_title":"MongoDB: GridFS remove method deletes all files in bucket","og_description":"Some time ago we ran into strange behaviour of MongoDB's GridFS which caused me creating a Bug Ticket for the MongoDB Java driver. Today I found the link","og_url":"https:\/\/www.javacodegeeks.com\/2013\/11\/mongodb-gridfs-remove-method-deletes-all-files-in-bucket.html","og_site_name":"Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2013-11-24T23:00:25+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/mongodb-logo.jpg","type":"image\/jpeg"}],"author":"Michael Scharhag","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/mscharhag","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Michael Scharhag","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.javacodegeeks.com\/2013\/11\/mongodb-gridfs-remove-method-deletes-all-files-in-bucket.html#article","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/11\/mongodb-gridfs-remove-method-deletes-all-files-in-bucket.html"},"author":{"name":"Michael Scharhag","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/0f0f81e875d40e3f820392e0ffce65d1"},"headline":"MongoDB: GridFS remove method deletes all files in bucket","datePublished":"2013-11-24T23:00:25+00:00","mainEntityOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/11\/mongodb-gridfs-remove-method-deletes-all-files-in-bucket.html"},"wordCount":288,"commentCount":1,"publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/11\/mongodb-gridfs-remove-method-deletes-all-files-in-bucket.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/mongodb-logo.jpg","keywords":["MongoDB"],"articleSection":["Enterprise Java"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.javacodegeeks.com\/2013\/11\/mongodb-gridfs-remove-method-deletes-all-files-in-bucket.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.javacodegeeks.com\/2013\/11\/mongodb-gridfs-remove-method-deletes-all-files-in-bucket.html","url":"https:\/\/www.javacodegeeks.com\/2013\/11\/mongodb-gridfs-remove-method-deletes-all-files-in-bucket.html","name":"MongoDB: GridFS remove method deletes all files in bucket","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/11\/mongodb-gridfs-remove-method-deletes-all-files-in-bucket.html#primaryimage"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/11\/mongodb-gridfs-remove-method-deletes-all-files-in-bucket.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/mongodb-logo.jpg","datePublished":"2013-11-24T23:00:25+00:00","description":"Some time ago we ran into strange behaviour of MongoDB's GridFS which caused me creating a Bug Ticket for the MongoDB Java driver. Today I found the link","breadcrumb":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/11\/mongodb-gridfs-remove-method-deletes-all-files-in-bucket.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.javacodegeeks.com\/2013\/11\/mongodb-gridfs-remove-method-deletes-all-files-in-bucket.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/2013\/11\/mongodb-gridfs-remove-method-deletes-all-files-in-bucket.html#primaryimage","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/mongodb-logo.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/mongodb-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.javacodegeeks.com\/2013\/11\/mongodb-gridfs-remove-method-deletes-all-files-in-bucket.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Java","item":"https:\/\/www.javacodegeeks.com\/category\/java"},{"@type":"ListItem","position":3,"name":"Enterprise Java","item":"https:\/\/www.javacodegeeks.com\/category\/java\/enterprise-java"},{"@type":"ListItem","position":4,"name":"MongoDB: GridFS remove method deletes all files in bucket"}]},{"@type":"WebSite","@id":"https:\/\/www.javacodegeeks.com\/#website","url":"https:\/\/www.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Developers Resource Center","publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/0f0f81e875d40e3f820392e0ffce65d1","name":"Michael Scharhag","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/52283459bfc820fb6a66704b3eccc771a1d8a63a0bdbbe1651bb5cb383a42148?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/52283459bfc820fb6a66704b3eccc771a1d8a63a0bdbbe1651bb5cb383a42148?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/52283459bfc820fb6a66704b3eccc771a1d8a63a0bdbbe1651bb5cb383a42148?s=96&d=mm&r=g","caption":"Michael Scharhag"},"description":"Michael Scharhag is a Java Developer, Blogger and technology enthusiast. Particularly interested in Java related technologies including Java EE, Spring, Groovy and Grails.","sameAs":["http:\/\/www.mscharhag.com\/","https:\/\/x.com\/https:\/\/twitter.com\/mscharhag"],"url":"https:\/\/www.javacodegeeks.com\/author\/michael-scharhag"}]}},"_links":{"self":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/19160","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/users\/514"}],"replies":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=19160"}],"version-history":[{"count":0,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/19160\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media\/187"}],"wp:attachment":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=19160"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=19160"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=19160"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}