Checks if an event belongs to the desired file type

@param event the event to check
@return the boolean value corresponding to the output
357846
private boolean isFileType(WatchEvent event, String fileType) {
        return event.context().toString().contains(fileType);
    }
1046198
@Override
    public ZeroCopyFileWriter write(String event) {
//        String realPath = FileHandlerUtil.generateOutputFilePath(path);

        String realPath = FileHandlerUtil.generateOutputFilePath(
    			path, 
    			FileHandlerUtil.generateAuditFileName());

        try {
           /** Close last instance for random access file. **/
			if (randomAccessFile != null && !realPath.equals(lastRealPath)) {
				this.stop();
			}
			
			if (randomAccessFile == null) {
				lastRealPath = realPath;
				randomAccessFile = new RandomAccessFile(new File(realPath), CoreConstants.READ_WRITE);
			}
        } catch (FileNotFoundException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }

        fileChannel = randomAccessFile.getChannel();
        
        String str2 = event + CoreConstants.NEW_LINE;

        long numBytes = str2.getBytes().length;

        InputStream inputStream = new ByteArrayInputStream(str2.getBytes(Charset.forName("UTF-8")));

        try {

            // move the cursor to the end of the file
            randomAccessFile.seek(randomAccessFile.length());

            // obtain the a file channel from the RandomAccessFile
            try (ReadableByteChannel inputChannel = Channels.newChannel(inputStream);) {
                fileChannel.transferFrom(inputChannel, randomAccessFile.length(), numBytes);
            } catch (IOException e) {
                e.printStackTrace();
            }

        } catch (IOException e) {
            e.printStackTrace();
        }
        return this;
    }
480303
private boolean isCaptionEvent(NativeEvent event) {

        EventTarget target = event.getEventTarget();
        if (com.google.gwt.dom.client.Element.is(target)) {
            return m_caption.getElement().isOrHasChild(com.google.gwt.dom.client.Element.as(target));
        }
        return false;
    }
684980
private static boolean isSupported(final File file)
        {
        final String extension = FilenameUtils.getExtension(file.getName());
        if (StringUtils.isBlank(extension))
            {
            return false;
            }
        
        final String[] types = 
            {
            "mp3", "aif", "aiff", "wav", "mp2", "mp4",
            "aac", "mid", "m4a", "m4p", "ogg"
            };
        if (ArrayUtils.contains(types, extension.toLowerCase()))
            {
            return true;
            }
        return false;
        }
792724
function onQuickFormEvent($event, $arg, &$caller)
    {
        switch ($event) {
            case 'updateValue':
                if ($caller->getAttribute('method') == 'get') {
                    return self::raiseError('Cannot add a file upload field to a GET method form');
                }
                $this->_value = $this->_findValue();
                $caller->updateAttributes(array('enctype' => 'multipart/form-data'));
                $caller->setMaxFileSize();
                break;
            case 'addElement':
                $this->onQuickFormEvent('createElement', $arg, $caller);
                return $this->onQuickFormEvent('updateValue', null, $caller);
                break;
            case 'createElement':
                static::__construct($arg[0], $arg[1], $arg[2], $arg[3], $arg[4]);
                break;
        }
        return true;
    }
865787
function isDraggingFiles(event) {
	// If `event.dataTransfer` is not available then `event.target.files` fallback is used.
	if (!event.dataTransfer) {
		return true
	}
	// https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer/types
	// https://developer.mozilla.org/en-US/docs/Web/API/HTML_Drag_and_Drop_API/Recommended_drag_types#file
	return Array.prototype.some.call(
		event.dataTransfer.types,
		type => type === 'Files' || type === 'application/x-moz-file'
	)
}
1077632
public boolean isDeathRelatedEvent(final Attribute event) {
        if (isDeathEvent(event)) {
            return true;
        }
        if (isPostDeathEvent(event)) {
            return true;
        }
        return isUnorderedEvent(event);
    }
450750
public static boolean isFile(Resource resource) {
        return resource.isResourceType(ResourceUtil.TYPE_FILE) ||
                resource.isResourceType(ResourceUtil.TYPE_LINKED_FILE);
    }
620835
public function isAppropriate(FileEvent $event)
    {
        if ($this->match === false) {
            return false;
        }

        foreach ($this->match as $pattern) {
            if (preg_match($pattern, $event->realPath) > 0) {
                return true;
            }
        }
        return false;
    }
464953
public boolean isPostDeathEvent(final Attribute event) {
        if ("Burial".equals(event.getString())) {
            return true;
        }
        if ("Cremation".equals(event.getString())) {
            return true;
        }
        if ("Funeral".equals(event.getString())) {
            return true;
        }
        return "Headstone unveiling".equals(event.getString());
    }
543890
public boolean contains(MotionEvent event){
		if (mPath.isEmpty())
			return false;
		RectF bounds = new RectF(); //bounds of the Path
		mPath.computeBounds(bounds, true);
		Region region = new Region();
		//Path has been computed in #draw (we assume that if it can be clicked, it has been drawn before). 
		region.setPath(mPath, new Region((int)bounds.left, (int)bounds.top, 
				(int) (bounds.right), (int) (bounds.bottom)));
		return region.contains((int)event.getX(), (int)event.getY());
	}
152371
@Override
    public void discard(Event event) {
        File eventFile = new File(bufferDir, event.getId().toString() + FILE_SUFFIX);
        if (eventFile.exists()) {
            logger.debug("Discarding Event from offline storage: " + eventFile.getAbsolutePath());
            if (!eventFile.delete()) {
                logger.warn("Failed to delete Event: " + eventFile.getAbsolutePath());
            }
        }
    }
1245089
public
  int decide(LoggingEvent event) {
    if(this.levelMin != null
      && event.getLevel().isGreaterOrEqual(levelMin) == false) {
        // level of event is less than minimum
        return Filter.DENY;
    }

    if(this.levelMax != null
      && event.getLevel().toInt() > levelMax.toInt()) {
        // level of event is greater than maximum
        // Alas, there is no Level.isGreater method. and using
        // a combo of isGreaterOrEqual && !Equal seems worse than
        // checking the int values of the level objects..
        return Filter.DENY;
    }

    if (acceptOnMatch) {
      // this filter set up to bypass later filters and always return
      // accept if level in range
      return Filter.ACCEPT;
    }
    else {
      // event is ok for this filter; allow later filters to have a look..
      return Filter.NEUTRAL;
    }
  }
237184
function validateEvent(event) {
	if (typeof event !== 'object' || !event) throw new TypeError('event must be an Object');
	if (typeof event.type !== 'string' || !event.type.length) throw new TypeError('event.type must be a non-empty String');
	if (!event.aggregateId && !event.sagaId) throw new TypeError('either event.aggregateId or event.sagaId is required');
	if (event.sagaId && typeof event.sagaVersion === 'undefined') throw new TypeError('event.sagaVersion is required, when event.sagaId is defined');
}
362119
@Override
    public boolean supports(E event) {
        final Class<? extends ApplicationEvent> eventType = event.getClass();
        final Boolean cachedSupports = this.supportedEventsCache.get(eventType);
        if (cachedSupports != null) {
            return cachedSupports;
        }

        final boolean supports = supportsEventTypeHelper(eventType);
        this.supportedEventsCache.put(eventType, supports);
        return supports;
    }
865537
@Check(CheckType.FAST)
	public void checkSuperType(SarlEvent event) {
		checkSuperTypes(
				event,
				SARL_EVENT__EXTENDS,
				Utils.singletonList(event.getExtends()),
				Event.class,
				false);
	}
815161
@Override
    public void add(Event event) {
        if (getNumStoredEvents() >= maxEvents) {
            logger.warn("Not adding Event because at least "
                + Integer.toString(maxEvents) + " events are already stored: " + event.getId());
            return;
        }

        File eventFile = new File(bufferDir.getAbsolutePath(), event.getId().toString() + FILE_SUFFIX);
        if (eventFile.exists()) {
            logger.trace("Not adding Event to offline storage because it already exists: "
                + eventFile.getAbsolutePath());
            return;
        } else {
            logger.debug("Adding Event to offline storage: " + eventFile.getAbsolutePath());
        }

        try (FileOutputStream fileOutputStream = new FileOutputStream(eventFile);
             ObjectOutputStream objectOutputStream = new ObjectOutputStream(fileOutputStream)) {
            objectOutputStream.writeObject(event);
        } catch (Exception e) {
            logger.error("Error writing Event to offline storage: " + event.getId(), e);
        }

        logger.debug(Integer.toString(getNumStoredEvents())
            + " stored events are now in dir: "
            + bufferDir.getAbsolutePath());
    }