@Test public void testIconNotfound() { final NSImageIconCache cache = new NSImageIconCache(); assertNull(cache.iconNamed(null, 64)); }
@Override public NSImage iconNamed(final String name, final Integer width, final Integer height) { NSImage image = this.load(name, width); if(null == image) { if(null == name) { return this.iconNamed("notfound.tiff", width, height); } else if(name.indexOf(Local.DELIMITER) != -1) { return this.cache(FilenameUtils.getName(name), this.convert(FilenameUtils.getName(name), NSImage.imageWithContentsOfFile(name), width, height), width); } else { return this.cache(name, this.convert(name, NSImage.imageNamed(name), width, height), width); } } return image; }
NSImageIconCache implements IconCache<NSImage> { @Override public NSImage iconNamed(final String name, final Integer width, final Integer height) { NSImage image = this.load(name, width); if(null == image) { if(null == name) { return this.iconNamed("notfound.tiff", width, height); } else if(name.indexOf(Local.DELIMITER) != -1) { return this.cache(FilenameUtils.getName(name), this.convert(FilenameUtils.getName(name), NSImage.imageWithContentsOfFile(name), width, height), width); } else { return this.cache(name, this.convert(name, NSImage.imageNamed(name), width, height), width); } } return image; } }
NSImageIconCache implements IconCache<NSImage> { @Override public NSImage iconNamed(final String name, final Integer width, final Integer height) { NSImage image = this.load(name, width); if(null == image) { if(null == name) { return this.iconNamed("notfound.tiff", width, height); } else if(name.indexOf(Local.DELIMITER) != -1) { return this.cache(FilenameUtils.getName(name), this.convert(FilenameUtils.getName(name), NSImage.imageWithContentsOfFile(name), width, height), width); } else { return this.cache(name, this.convert(name, NSImage.imageNamed(name), width, height), width); } } return image; }  }
NSImageIconCache implements IconCache<NSImage> { @Override public NSImage iconNamed(final String name, final Integer width, final Integer height) { NSImage image = this.load(name, width); if(null == image) { if(null == name) { return this.iconNamed("notfound.tiff", width, height); } else if(name.indexOf(Local.DELIMITER) != -1) { return this.cache(FilenameUtils.getName(name), this.convert(FilenameUtils.getName(name), NSImage.imageWithContentsOfFile(name), width, height), width); } else { return this.cache(name, this.convert(name, NSImage.imageNamed(name), width, height), width); } } return image; }  @Override NSImage documentIcon(final String extension, final Integer size); @Override NSImage documentIcon(final String extension, final Integer size, final NSImage badge); @Override NSImage folderIcon(final Integer size); @Override NSImage folderIcon(final Integer size, final NSImage badge); @Override NSImage iconNamed(final String name, final Integer width, final Integer height); @Override NSImage fileIcon(final Local file, final Integer size); @Override NSImage applicationIcon(final Application app, final Integer size); @Override NSImage fileIcon(final Path file, final Integer size); @Override NSImage aliasIcon(final String extension, final Integer size); }
NSImageIconCache implements IconCache<NSImage> { @Override public NSImage iconNamed(final String name, final Integer width, final Integer height) { NSImage image = this.load(name, width); if(null == image) { if(null == name) { return this.iconNamed("notfound.tiff", width, height); } else if(name.indexOf(Local.DELIMITER) != -1) { return this.cache(FilenameUtils.getName(name), this.convert(FilenameUtils.getName(name), NSImage.imageWithContentsOfFile(name), width, height), width); } else { return this.cache(name, this.convert(name, NSImage.imageNamed(name), width, height), width); } } return image; }  @Override NSImage documentIcon(final String extension, final Integer size); @Override NSImage documentIcon(final String extension, final Integer size, final NSImage badge); @Override NSImage folderIcon(final Integer size); @Override NSImage folderIcon(final Integer size, final NSImage badge); @Override NSImage iconNamed(final String name, final Integer width, final Integer height); @Override NSImage fileIcon(final Local file, final Integer size); @Override NSImage applicationIcon(final Application app, final Integer size); @Override NSImage fileIcon(final Path file, final Integer size); @Override NSImage aliasIcon(final String extension, final Integer size);  }